Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConvertOptions ¶
type ConvertOptions struct {
MethodAlias map[string]string
AllowedContentTypes []string
Prefix string
TrimPrefix string
EnvPrefix string
Strict bool
Logger *slog.Logger
}
ConvertOptions represent the common convert options for both OpenAPI v2 and v3
type OAS2Builder ¶
type OAS2Builder struct {
*ConvertOptions
// contains filtered or unexported fields
}
OAS2Builder the NDC schema builder from OpenAPI 2.0 specification
func NewOAS2Builder ¶
func NewOAS2Builder(schema *rest.NDCRestSchema, options ConvertOptions) *OAS2Builder
NewOAS2Builder creates an OAS3Builder instance
func (*OAS2Builder) BuildDocumentModel ¶
func (oc *OAS2Builder) BuildDocumentModel(docModel *libopenapi.DocumentModel[v2.Swagger]) error
func (*OAS2Builder) Schema ¶
func (oc *OAS2Builder) Schema() *rest.NDCRestSchema
Schema returns the inner NDC REST schema
type OAS3Builder ¶
type OAS3Builder struct {
*ConvertOptions
// contains filtered or unexported fields
}
OAS3Builder the NDC schema builder from OpenAPI 3.0 specification
func NewOAS3Builder ¶
func NewOAS3Builder(schema *rest.NDCRestSchema, options ConvertOptions) *OAS3Builder
NewOAS3Builder creates an OAS3Builder instance
func (*OAS3Builder) BuildDocumentModel ¶
func (oc *OAS3Builder) BuildDocumentModel(docModel *libopenapi.DocumentModel[v3.Document]) error
func (*OAS3Builder) Schema ¶
func (oc *OAS3Builder) Schema() *rest.NDCRestSchema
Schema returns the inner NDC REST schema
type SchemaInfoCache ¶ added in v0.2.2
type SchemaInfoCache struct {
Name string
Schema schema.TypeEncoder
}
SchemaInfoCache stores prebuilt information of component schema types.
type TypeUsageCounter ¶
TypeUsageCounter tracks the list of reference types and number of usage of them in other models
func (*TypeUsageCounter) Add ¶ added in v0.2.1
func (tuc *TypeUsageCounter) Add(name string, value int)
Increase increases the usage of an element
func (*TypeUsageCounter) Get ¶
func (tuc *TypeUsageCounter) Get(name string) int
Get returns the usage count of the input name