Categorygithub.com/go-openapi/spec3
modulepackage
0.0.0-20200311181749-3fab9faa9094
Repository: https://github.com/go-openapi/spec3.git
Documentation: pkg.go.dev

# README

OAI object model Build Status codecov Slack Status

license GoDoc

This repository is not usable at this moment, the implementation is incomplete

The object model for OpenAPI specification v3 documents.

It aims to fix some mistakes that were made in the spec for v2. Top-level maps are now sorted by default so you can rely on their ordering.

Schemas

Schemastruct{} + mapUnit tests (struct{} + map)
OpenAPI:ballot_box_with_check::black_square_button:
Info:ballot_box_with_check::black_square_button:
Contact:ballot_box_with_check::black_square_button:
License:ballot_box_with_check::black_square_button:
Server:ballot_box_with_check::black_square_button:
Server Variable:ballot_box_with_check: + :black_square_button::black_square_button: + :black_square_button:
Components:ballot_box_with_check::black_square_button:
Paths:ballot_box_with_check::black_square_button:
Path Item:ballot_box_with_check: + :black_square_button::black_square_button: + :black_square_button:
Operation:ballot_box_with_check::black_square_button:
External Documentation:ballot_box_with_check::black_square_button:
Parameter:ballot_box_with_check: + :black_square_button::black_square_button: + :black_square_button:
Request Body:ballot_box_with_check: + :black_square_button::black_square_button: + :black_square_button:
Media Type:ballot_box_with_check: + :black_square_button::black_square_button: + :black_square_button:
Encoding:ballot_box_with_check: + :black_square_button::black_square_button: + :black_square_button:
Responses:ballot_box_with_check: + :black_square_button::black_square_button: + :black_square_button:
Response:ballot_box_with_check::black_square_button:
Callback:ballot_box_with_check: + :black_square_button::black_square_button: + :black_square_button:
Example:ballot_box_with_check: + :black_square_button::black_square_button: + :black_square_button:
Link:ballot_box_with_check: + :black_square_button::black_square_button: + :black_square_button:
Header:ballot_box_with_check: + :black_square_button::black_square_button: + :black_square_button:
Tag:ballot_box_with_check::black_square_button:
Reference:ballot_box_with_check::black_square_button:
Schema:black_square_button: + :black_square_button::black_square_button: + :black_square_button:
Discriminator:ballot_box_with_check::black_square_button:
XML:ballot_box_with_check::black_square_button:
Security Scheme:ballot_box_with_check: + :black_square_button::black_square_button: + :black_square_button:
OAuth Flows:ballot_box_with_check::black_square_button:
OAuth Flow:ballot_box_with_check::black_square_button:
Security Requirement:ballot_box_with_check::black_square_button:

TODO

  • Update OrderedMap to use ART under the hood instead of the golang's map
  • Use GoJay for decoding/encoding the JSON
  • Retire EasyJson dependency from the project

# Functions

MatchAll keys, is used as default filter.
MatchExtension is used as filter for vendor extensions.
MatchNonEmptyKeys keys, is used to allow only non empty strings.
NewCallback creates a new instance of Callback with correct filter.
NewOrderedCallbacks creates a new instance of OrderedCallbacks with correct filter.
NewOrderedEncodings creates a new instance of OrderedEncodings with correct filter.
NewOrderedExamples creates a new instance of OrderedExamples with correct filter.
NewOrderedHeaders creates a new instance of OrderedHeaders with correct filter.
NewOrderedLinks creates a new instance of OrderedLinks with correct filter.
NewOrderedMediaTypes creates a new instance of OrderedMediaTypes with correct filter.
No description provided by the author
NewOrderedRequestBodies creates a new instance of OrderedRequestBodies with correct filter.
NewOrderedResponses creates the new instance of the OrderedResponses with correct key-filter.
NewOrderedSchemas creates a new instance of OrderedSchemas with correct filter.
NewOrderedSecuritySchemes creates a new instance of OrderedSecuritySchemes with correct filter.
NewOrderedStrings creates a new instance of OrderedStrings with correct filter.
NewServerVariables creates a new instance of ServerVariables with correct filter.
NOPNormalizer passes the key through, used as default.

# Variables

LowerCaseKeys lowercases keys when looking up in the map.

# Structs

Callback A map of possible out-of band callbacks related to the parent operation.
Components holds a set of reusable objects for different aspects of the OAS.
Contact contains information for the exposed API.easyjson:json.
Discriminator When request bodies or response payloads may be one of a number of different schemas, a discriminator object can be used to aid in serialization, deserialization, and validation.
Encoding definition applied to a single schema property.
Example.
Extensions vendor specific extensions.
ExternalDocumentation allows referencing an external resource for extended documentation.
Header follows the structure of the Parameter Object.
Info provides metadata about the API.
License contains information for the exposed API.
Link represents a possible design-time link for a response.
MapEntry represents a key value pair.
MediaType provides schema and examples for the media type identified by its key.
OAuthFlow configuration details for a supported OAuth Flow.
OAuthFlows allows configuration of the supported OAuth Flows.
OpenAPI is the root document object of the OpenAPI document.
Operation describes a single API operation on a path.
OrderedCallbacks is a map between a variable name and its value.
OrderedEncodings is a map between a variable name and its value.
OrderedExamples is a map between a variable name and its value.
OrderedHeaders is a map between a variable name and its value.
OrderedLinks is a map between a variable name and its value.
OrderedMap is a map that preserves insertion order.
OrderedMediaTypes is a map between a variable name and its value.
No description provided by the author
OrderedRequestBodies is a map between a variable name and its value.
OrderedResponses is a container for the expected responses of an operation.
OrderedSchemas is a map between a variable name and its value.
OrderedSecuritySchemes is a map between a variable name and its value.
OrderedStrings is a map between a variable name and its value.
Parameter describes a single operation parameter.
PathItem describes the operations available on a single path.
Paths holds the relative paths to the individual endpoints and their operations.
Reference is a simple object to allow referencing other components in the specification, internally and externally.
RequestBody describes a single request body.
Response describes a single response from an API Operation, including design-time, static links to operations based on the response.
Schema object allows the definition of input and output data types.
SecurityRequirement lists the required security schemes to execute this operation.
SecurityScheme defines a security scheme that can be used by the operations.
Server object representing a Server.
ServerVariable object representing a Server Variable for server URL template substitution.
ServerVariables is a map between a variable name and its value.
Tag adds metadata to a single tag that is used by the Operation Object.
VendorExtensible composition block.
XML a metadata object that allows for more fine-tuned XML model definitions.

# Type aliases

Filter for deciding which keys make it into the sorted map.
Normalizer is used to normalize keys when writing to a map.