Common attributes for JSON schema types.

IJsonSchemaAttribute is a common interface for all JSON schema types supported in here @samchon/openapi. Here is the list of affected JSON schema types in @samchon/openapi, and you can extend the interface by declaring module augmentation.

For example, if you extend the IJsonSchemaAttribute interface like below, every JSON schema types in @samchon/openapi will have a new custom attribute x-wrtn-placeholder.

Also, if you augment the nested type like IJsonSchemaAttribute.IString, you can add the custom attribute to every string types in the JSON schema. In the below example case, every string types will have a new custom attribute x-wrtn-secret-key.

declare module "@samchon/openapi" {
export interface IJsonSchemaAttribute {
/// Placeholder value for frontend application
///
/// Placeholder ia label shown in the input field as a hint.
/// For example, when an email input field exists, the label
/// value would be "Insert your email address here".
"x-wrtn-placeholder"?: string;
}
export namespace IJsonSchemaAttribute {
export interface IString {
/// Secret key for the schema.
///
/// `x-wrtn-secret-key` is a property means a secret key
/// that is required for the target API endpoint calling.
/// If the secret key is not filled, the API call would
/// be failed.
"x-wrtn-secret-key"?: string;
}
}
}

Jeongho Nam - https://github.com/samchon

interface IAllOf {
    allOf: OpenApiV3.IJsonSchema[];
    deprecated?: boolean;
    description?: string;
    example?: any;
    examples?: Record<string, any>;
    title?: string;
}

Hierarchy (View Summary)

Properties

deprecated?: boolean

Whether the type is deprecated or not.

description?: string

Detailed description of the schema.

example?: any

Example value.

examples?: Record<string, any>

List of example values as key-value pairs.

title?: string

Title of the schema.