Repository navigation
Closed
Description
When parsing this v3.0.1 schema:
openapi: 3.0.1
info:
title: ping test
version: '1.0'
servers:
- url: 'http://localhost:8000/'
paths:
/ping:
get:
operationId: pingGet
responses:
'201':
description: OK
components:
schemas:
AnyValue: {}
AnyValueWithDesc:
description: Can be any value - string, number, boolean, array or object.
AnyValueNullable:
nullable: true
description: Can be any value, including `null`.
AnyValueModel:
description: test any value
type: object
properties:
any_value:
$ref: '#/components/schemas/AnyValue'
any_value_with_desc:
$ref: '#/components/schemas/AnyValueWithDesc'
any_value_nullable:
$ref: '#/components/schemas/AnyValueNullable'
AnyValueModelInline:
description: test any value inline
type: object
properties:
any_value: {}
any_value_with_desc:
description: inline any value
any_value_nullable:
nullable: true
description: inline any value nullable
map_any_value:
additionalProperties: {}
map_any_value_with_desc:
additionalProperties:
description: inline any value
map_any_value_nullable:
additionalProperties:
nullable: true
description: inline any value nullable
array_any_value:
items: {}
array_any_value_with_desc:
items:
description: inline any value
array_any_value_nullable:
items:
nullable: true
description: inline any value nullable
swagger-parser incorrectly defines the type of the schemas:
- map_any_value as object when it should be null
- map_any_value_with_desc as object when it should be null
- map_any_value_nullable as object when it should be null
- array_any_value as array when it should be null
- array_any_value_with_desc as array when it should be null
- array_any_value_nullable as array when it should be null
Using swagger-parser 2.0.26
For one of them here is the shown value of the schema
map_any_value -> {MapSchema@2888} "class MapSchema {
class Schema {
type: object
format: null
$ref: null
description: null
title: null
multipleOf: null
maximum: null
exclusiveMaximum: null
minimum: null
exclusiveMinimum: null
maxLength: null
minLength: null
pattern: null
maxItems: null
minItems: null
uniqueItems: null
maxProperties: null
minProperties: null
required: null
not: null
properties: null
additionalProperties: class Schema {
type: null
format: null
$ref: null
description: null
title: null
multipleOf: null
maximum: null
exclusiveMaximum: null
minimum: null
exclusiveMinimum: null
maxLength: null
minLength: null
pattern: null
maxItems: null
minItems: null
"
Reacted by Thorsten Hake
Metadata
Metadata
Assignees
Labels
No labels
Activity
[-]Incorrect type set for AnyType Schema[/-][+]Incorrect type set for AnyType Schemas[/+]includes support for #1603
gracekarina commentedon Feb 2, 2022
This ticket will be solved when 3.1 branch is merged.
oas 3.1 - includes support for #1603
oas 3.1 - includes support for #1603
oas 3.1 - includes support for #1603
spacether commentedon Jun 28, 2022
Using swagger-parser
2.0.31This issue is also happening for:
PropertyRefsContainingComponentSchema type should be unset but it is incorrectly set to object
frantuma commentedon Jul 7, 2022
This should be fixed in #1768, see this comment.
Closing ticket, please reopen if you're experiencing further issues