Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance JSONSchema documentation and visibility of types #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

1amageek
Copy link

Description:

This pull request introduces the following improvements to the JSONSchema class:

  1. Detailed Documentation:

    • Added comprehensive comments to the JSONSchema class and its components.
    • Describes features, usage, and the supported schema types.
  2. Public Accessors:

    • Made the SchemaType enum public, enabling external access to supported schema types.
    • Added public properties type and description for the JSONSchema class, providing external visibility to the schema's type and description.
  3. Enhanced Enum Definition:

    • Updated SchemaType with support for Codable and Sendable.

Changes:

  • Improved documentation for JSONSchema and SchemaType:
    /// A class that represents a JSON Schema definition.
    ///
    /// `JSONSchema` is a flexible representation of a JSON Schema. It supports multiple schema types,
    /// including arrays, booleans, enums, integers, nulls, numbers, objects, and strings. The schema
    /// includes detailed metadata and type-specific information.
    ///
    /// ## Features
    /// - Supports various schema types.
    /// - Provides detailed descriptions for schema elements.
    /// - Implements `Codable` and `Sendable` for serialization and concurrency safety.
    public final class JSONSchema: Codable, Sendable {
        /// Enumeration of the supported JSON Schema types.
        public enum SchemaType: String, Codable, Sendable {
            case array
            case boolean
            case `enum`
            case string
        }
    
        /// The type of the schema.
        public let type: SchemaType
    
        /// An optional description providing additional information about the schema.
        public let description: String?
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant