The implementation of OpenAPI v3.1 Specification for Go using generics.
- v1.23
- v1.22
- v1.21
- v0 - Deprecated. The initial version with the full implementation of the v3.1 Specification using generics. See
v0
branch. - v1 - The current version with the in-place validation of the specification.
The minimal version of Go is
v1.21
and thegithub.com/santhosh-tekuri/jsonschema/v5
package is not used anymore. Seemain
branch.
- The
spec
folder contains full implementation of the v3.1 Specification using generics anderrors.Join
function, so the minimum supported version of Go isv1.20
. - The
spec.ValidateSpec
function validates the specification without transforming it tomap[string]any
. - The official v3.0 and v3.1 examples are tested.
In most cases v3.0 specification can be converted to v3.1 by changing the version's parameter only.
@@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: "3.1.0"
NOTE: The descriptions of most structures and their fields are taken from the official documentations.
- OpenAPI Specification: https://github.com/OAI/OpenAPI-Specification and https://spec.openapis.org/oas/v3.1.0
- JSON Schema: https://json-schema.org/understanding-json-schema/index.html and https://json-schema.org/draft/2020-12/json-schema-core.html
- The list of most popular alternatives: https://tools.openapis.org
MIT licensed. See the bundled LICENSE file for more details.