Documentation ¶
Index ¶
- type SchemaRef
- type SecurityRequirement
- type Spec
- func (s *Spec) AllDefinitionReferences() (result []string)
- func (s *Spec) AllDefinitions() (result []SchemaRef)
- func (s *Spec) AllItemsReferences() (result []string)
- func (s *Spec) AllParameterReferences() (result []string)
- func (s *Spec) AllPaths() map[string]spec.PathItem
- func (s *Spec) AllReferences() (result []string)
- func (s *Spec) AllRefs() (result []spec.Ref)
- func (s *Spec) AllResponseReferences() (result []string)
- func (s *Spec) ConsumesFor(operation *spec.Operation) []string
- func (s *Spec) OperationFor(method, path string) (*spec.Operation, bool)
- func (s *Spec) OperationForName(operationID string) (string, string, *spec.Operation, bool)
- func (s *Spec) OperationIDs() []string
- func (s *Spec) Operations() map[string]map[string]*spec.Operation
- func (s *Spec) ParametersFor(operationID string) []spec.Parameter
- func (s *Spec) ParamsFor(method, path string) map[string]spec.Parameter
- func (s *Spec) ProducesFor(operation *spec.Operation) []string
- func (s *Spec) RequiredConsumes() []string
- func (s *Spec) RequiredProduces() []string
- func (s *Spec) RequiredSecuritySchemes() []string
- func (s *Spec) SchemasWithAllOf() (result []SchemaRef)
- func (s *Spec) SecurityDefinitionsFor(operation *spec.Operation) map[string]spec.SecurityScheme
- func (s *Spec) SecurityRequirementsFor(operation *spec.Operation) []SecurityRequirement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SecurityRequirement ¶
SecurityRequirement is a representation of a security requirement for an operation
type Spec ¶
type Spec struct {
// contains filtered or unexported fields
}
Spec takes a swagger spec object and turns it into a registry with a bunch of utility methods to act on the information in the spec
func New ¶
New takes a swagger spec object and returns an analyzed spec document. The analyzed document contains a number of indices that make it easier to reason about semantics of a swagger specification for use in code generation or validation etc.
func (*Spec) AllDefinitionReferences ¶
AllDefinitionReferences returns json refs for all the discovered schemas
func (*Spec) AllDefinitions ¶
AllDefinitions returns schema references for all the definitions that were discovered
func (*Spec) AllItemsReferences ¶
AllItemsReferences returns the references for all the items
func (*Spec) AllParameterReferences ¶
AllParameterReferences returns json refs for all the discovered parameters
func (*Spec) AllReferences ¶
AllReferences returns all the references found in the document
func (*Spec) AllResponseReferences ¶
AllResponseReferences returns json refs for all the discovered responses
func (*Spec) ConsumesFor ¶
ConsumesFor gets the mediatypes for the operation
func (*Spec) OperationFor ¶
OperationFor the given method and path
func (*Spec) OperationForName ¶
OperationForName gets the operation for the given id
func (*Spec) OperationIDs ¶
OperationIDs gets all the operation ids based on method an dpath
func (*Spec) Operations ¶
Operations gathers all the operations specified in the spec document
func (*Spec) ParametersFor ¶
ParametersFor the specified operation id
func (*Spec) ParamsFor ¶
ParamsFor the specified method and path. Aggregates them with the defaults etc, so it's all the params that apply for the method and path.
func (*Spec) ProducesFor ¶
ProducesFor gets the mediatypes for the operation
func (*Spec) RequiredConsumes ¶
RequiredConsumes gets all the distinct consumes that are specified in the specification document
func (*Spec) RequiredProduces ¶
RequiredProduces gets all the distinct produces that are specified in the specification document
func (*Spec) RequiredSecuritySchemes ¶
RequiredSecuritySchemes gets all the distinct security schemes that are specified in the swagger spec
func (*Spec) SchemasWithAllOf ¶
SchemasWithAllOf returns schema references to all schemas that are defined with an allOf key
func (*Spec) SecurityDefinitionsFor ¶
SecurityDefinitionsFor gets the matching security definitions for a set of requirements
func (*Spec) SecurityRequirementsFor ¶
func (s *Spec) SecurityRequirementsFor(operation *spec.Operation) []SecurityRequirement
SecurityRequirementsFor gets the security requirements for the operation