We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi @fenollp,
It seems that cleaning the ref.Value https://github.com/getkin/kin-openapi/blob/v0.124.0/openapi3gen/openapi3gen.go#L150 is no more actual. A type refers a subtype, thus it is necessary not only to preserve the Ref but also the Value. Otherwise the validation of schema fails.
Don't you think so?
CC @EnriqueL8
func (g *Generator) NewSchemaRefForValue(value interface{}, schemas openapi3.Schemas) (*openapi3.SchemaRef, error) { ref, err := g.GenerateSchemaRef(reflect.TypeOf(value)) if err != nil { return nil, err } for ref := range g.SchemaRefs { refName := ref.Ref if g.opts.exportComponentSchemas.ExportComponentSchemas && strings.HasPrefix(refName, "#/components/schemas/") { refName = strings.TrimPrefix(refName, "#/components/schemas/") } if _, ok := g.componentSchemaRefs[refName]; ok && schemas != nil { if ref.Value != nil && ref.Value.Properties != nil { schemas[refName] = &openapi3.SchemaRef{ Value: ref.Value, } } } if strings.HasPrefix(ref.Ref, "#/components/schemas/") { ref.Value = nil } else { ref.Ref = "" } } return ref, nil }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi @fenollp,
It seems that cleaning the ref.Value https://github.com/getkin/kin-openapi/blob/v0.124.0/openapi3gen/openapi3gen.go#L150 is no more actual. A type refers a subtype, thus it is necessary not only to preserve the Ref but also the Value. Otherwise the validation of schema fails.
Don't you think so?
CC @EnriqueL8
The text was updated successfully, but these errors were encountered: