diff --git a/contact.go b/contact.go index 1da79d9..f968a7d 100644 --- a/contact.go +++ b/contact.go @@ -7,9 +7,9 @@ import ( ) // Contact information for the exposed API. -// ([Source]) +// ([Documentation]) // -// [Source]: https://spec.openapis.org/oas/v3.1.0#contact-object +// [Documentation]: https://spec.openapis.org/oas/v3.1.0#contact-object type Contact struct { // The identifying name of the contact person/organization. Name string `json:"name,omitempty,strictcase" yaml:"name,omitempty"` diff --git a/document.go b/document.go index 2f135bc..7deb2cb 100644 --- a/document.go +++ b/document.go @@ -1,18 +1,25 @@ package openapi -import "regexp" +import ( + "net/url" + "regexp" +) // Document is an OpenAPI document. // It is a self-contained or composite resource which defines or describes an API or elements of an API. // An OpenAPI document uses and conforms to the OpenAPI Specification. -// ([Source]) +// ([Documentation]) // -// [Source]: https://spec.openapis.org/oas/v3.1.0#openapi-document +// [Documentation]: https://spec.openapis.org/oas/v3.1.0#openapi-document type Document struct { // REQUIRED. This string MUST be the version number of the OpenAPI Specification that the OpenAPI document uses. The openapi field SHOULD be used by tooling to interpret the OpenAPI document. This is not related to the API info.version string. OpenAPI string `json:"openapi,strictcase" yaml:"openapi"` // REQUIRED. Provides metadata about the API. The metadata MAY be used by tooling as required. Info *Info `json:"info,strictcase" yaml:"info"` + // The default value for the $schema keyword within Schema Objects contained within this OAS document. This MUST be in the form of a URI. + // Default: "https://spec.openapis.org/oas/3.1/dialect/base" + // NOTE: Anything other than the default value is not supported. + JSONSchemaDialect *url.URL `json:"jsonSchemaDialect,omitempty,strictcase" yaml:"jsonSchemaDialect,omitempty"` } // reOpenAPIVersion is a regular expression that matches the OpenAPI version. diff --git a/extensions.go b/extensions.go index 3bc87ef..563b727 100644 --- a/extensions.go +++ b/extensions.go @@ -13,7 +13,7 @@ import ( // While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points. // // The field name MUST begin with x-, for example, x-internal-id. Field names beginning x-oai- and x-oas- are reserved for uses defined by the OpenAPI Initiative. The value can be null, a primitive, an array or an object. -// ([Source]) +// ([Documentation]) // // It is here an alias of jsontext.Value to allow inlining within structs, enabling // seamless marshalling and unmarshalling. Using jsontext.Value preserves the order @@ -25,7 +25,7 @@ import ( // Note: For convenience, certain common extensions are implemented as fields // directly within the respective structs. // -// [Source]: https://spec.openapis.org/oas/v3.1.0#specification-extensions +// [Documentation]: https://spec.openapis.org/oas/v3.1.0#specification-extensions type Extensions = jsontext.Value func validateExtensions(ext Extensions) error { diff --git a/info.go b/info.go index 9f7754e..0198ae1 100644 --- a/info.go +++ b/info.go @@ -5,9 +5,9 @@ import ( ) // The Info object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience. -// ([Source]) +// ([Documentation]) // -// [Source]: https://spec.openapis.org/oas/v3.1.0#info-object +// [Documentation]: https://spec.openapis.org/oas/v3.1.0#info-object type Info struct { // REQUIRED. The title of the API. Title string `json:"title,strictcase" yaml:"title"` diff --git a/license_struct.go b/license_struct.go index ba4e17a..bc035c7 100644 --- a/license_struct.go +++ b/license_struct.go @@ -6,9 +6,9 @@ import ( ) // License information for the exposed API. -// ([Source]) +// ([Documentation]) // -// [Source]: https://spec.openapis.org/oas/v3.1.0#license-object +// [Documentation]: https://spec.openapis.org/oas/v3.1.0#license-object type License struct { // REQUIRED. The license name used for the API. Name string `json:"name,strictcase" yaml:"name"`