Skip to content

Commit

Permalink
Don't import openapi2 array as list (#923)
Browse files Browse the repository at this point in the history
  • Loading branch information
AriehSchneier committed Jun 11, 2024
1 parent f5435c3 commit bb2cdd9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/importer/openapi3_legacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ func (o *OpenAPI3Importer) buildField(name string, prop *openapi3.SchemaRef) (Fi

if isArray && prop.Value.Items.Ref != "" {
f.Type = &Array{Items: nameOnlyType(typeNameFromSchemaRef(prop.Value.Items))}
f.SizeSpec = makeSizeSpec(prop.Value.MinItems, prop.Value.MaxItems)
// f.SizeSpec = makeSizeSpec(prop.Value.MinItems, prop.Value.MaxItems)
return f, nil
}

Expand Down
2 changes: 2 additions & 0 deletions pkg/importer/tests/openapi2/array-in-object.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ definitions:
type: array
items:
$ref: '#/definitions/OtherObject'
minItems: 1
maxItems: 10
missingItems:
type: array
OtherObject:
Expand Down

0 comments on commit bb2cdd9

Please sign in to comment.