# README
OpenAPI analysis

A foundational library to analyze an OAI specification document for easier reasoning about the content.
What's inside?
- An analyzer providing methods to walk the functional content of a specification
- A spec flattener producing a self-contained document bundle, while preserving
$ref
s - A spec merger ("mixin") to merge several spec documents into a primary spec
- A spec "fixer" ensuring that response descriptions are non empty
FAQ
- Does this library support OpenAPI 3?
No. This package currently only supports OpenAPI 2.0 (aka Swagger 2.0). There is no plan to make it evolve toward supporting OpenAPI 3.x. This discussion thread relates the full story.
# Functions
FixEmptyDesc adds "(empty)" as the description to the given Response object if it doesn't already have one and isn't a ref.
FixEmptyDescs adds "(empty)" as the description for any Response in the given Responses object that doesn't already have one.
FixEmptyResponseDescriptions replaces empty ("") response descriptions in the input with "(empty)" to ensure that the resulting Swagger is stays valid.
Flatten an analyzed spec and produce a self-contained spec bundle.
GenLocation indicates from which section of the specification (models or operations) a definition has been created.
Mixin modifies the primary swagger spec by adding the paths and definitions from the mixin specs.
New takes a swagger spec object and returns an analyzed spec document.
Schema analysis, will classify the schema according to known patterns.
# Structs
AnalyzedSchema indicates what the schema represents.
FlattenOpts configuration for flattening a swagger specification.
InlineSchemaNamer finds a new name for an inlined type.
SchemaOpts configures the schema analyzer.
SchemaRef is a reference to a schema.
SecurityRequirement is a representation of a security requirement for an operation.
Spec is an analyzed specification object.
# Type aliases
ErrorOnParamFunc is a callback function to be invoked whenever an error is encountered while resolving references on parameters.