Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pkg/codegen/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ type Schema struct {
SkipOptionalPointer bool // Some types don't need a * in front when they're optional

Description string // The description of the element

// The original OpenAPIv3 Schema.
OAPISchema *openapi3.Schema
}

func (s Schema) IsRef() bool {
Expand Down Expand Up @@ -162,6 +165,7 @@ func GenerateGoSchema(sref *openapi3.SchemaRef, path []string) (Schema, error) {

outSchema := Schema{
Description: StringToGoComment(schema.Description),
OAPISchema: schema,
}

// We can't support this in any meaningful way
Expand All @@ -184,6 +188,7 @@ func GenerateGoSchema(sref *openapi3.SchemaRef, path []string) (Schema, error) {
if err != nil {
return Schema{}, errors.Wrap(err, "error merging schemas")
}
mergedSchema.OAPISchema = schema
return mergedSchema, nil
}

Expand Down