OpenApiSchema
Defines the top-level schema for request bodies and responses.
This type represents complete object schemas used in OpenAPI operations, typically for request bodies and response content.
Example
const userSchema: OpenApiSchema = {
type: "object",
properties: {
id: {type: "string"},
name: {type: "string"},
email: {type: "string", format: "email"},
},
required: ["id", "name"],
};
Indexable
[
key:string]:unknown
Properties
additionalProperties?
optionaladditionalProperties?:boolean|OpenApiSchemaProperty
Schema for additional properties or boolean to allow/disallow them
items?
optionalitems?:OpenApiSchemaProperty
Schema for array items when type is "array"
properties?
optionalproperties?:Record<string,OpenApiSchemaProperty>
Property definitions for object types
required?
optionalrequired?:string[]
List of required property names
type
type:
string
The JSON Schema type (typically "object" or "array")