OpenAPI Specification Schemas: Difference between revisions
Jump to navigation
Jump to search
(→Schema) |
|||
Line 9: | Line 9: | ||
The <code>/components/schemas</code> section of the OpenAPI specification defines reusable types that are used as input and output data types. These types can represent objects, but also primitives and arrays. The specification is based on [https://tools.ietf.org/html/draft-bhutton-json-schema-00 JSON Schema Specification Draft 2020-12]. A client or server code generator creates programming language types from these schemas. This article is annotated with details related to how <code>[[Oapi-codegen#Overview|oapi-codegen]]</code> generates Go code. | The <code>/components/schemas</code> section of the OpenAPI specification defines reusable types that are used as input and output data types. These types can represent objects, but also primitives and arrays. The specification is based on [https://tools.ietf.org/html/draft-bhutton-json-schema-00 JSON Schema Specification Draft 2020-12]. A client or server code generator creates programming language types from these schemas. This article is annotated with details related to how <code>[[Oapi-codegen#Overview|oapi-codegen]]</code> generates Go code. | ||
=Schema= | =Schema= | ||
<font size=-2> | <font size=-2> |
Revision as of 01:59, 26 January 2024
External
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schemaObject
- https://tools.ietf.org/html/draft-bhutton-json-schema-00
- https://tools.ietf.org/html/draft-bhutton-json-schema-validation-00
Internal
Overview
The /components/schemas
section of the OpenAPI specification defines reusable types that are used as input and output data types. These types can represent objects, but also primitives and arrays. The specification is based on JSON Schema Specification Draft 2020-12. A client or server code generator creates programming language types from these schemas. This article is annotated with details related to how oapi-codegen
generates Go code.
Schema
SchemaName type: required: properties: format: description: discriminator: externalDocs: