If additionalProperties exists in the fruit model, then
final Schema schema = openAPI.getComponents().getSchemas().get("fruit");
returns an instance of MapSchema.
Without additionalProperties, it returns the correct type of ComposedSchema.
incorrectly returns MapSchema as the type of the above schema instance for fruit.
openapi: 3.0.1
info:
title: fruity
version: 0.0.1
paths:
/:
get:
responses:
'200':
description: desc
content:
application/json:
schema:
$ref: '#/components/schemas/fruit'
components:
schemas:
fruit:
title: fruit
properties:
color:
type: string
oneOf:
- $ref: '#/components/schemas/apple'
- $ref: '#/components/schemas/banana'
additionalProperties:
type: string
apple:
title: apple
type: object
properties:
kind:
type: string
banana:
title: banana
type: object
properties:
count:
type: number
correctly returns ComposedSchema as the type of the above schema instance for fruit
openapi: 3.0.1
info:
title: fruity
version: 0.0.1
paths:
/:
get:
responses:
'200':
description: desc
content:
application/json:
schema:
$ref: '#/components/schemas/fruit'
components:
schemas:
fruit:
title: fruit
properties:
color:
type: string
oneOf:
- $ref: '#/components/schemas/apple'
- $ref: '#/components/schemas/banana'
apple:
title: apple
type: object
properties:
kind:
type: string
banana:
title: banana
type: object
properties:
count:
type: number
Requested change:
When additionalProperties is included in a composed schema, please return an instance of ComposedSchema which includes additionalProperties info.
If additionalProperties exists in the fruit model, then
final Schema schema = openAPI.getComponents().getSchemas().get("fruit");returns an instance of MapSchema.
Without additionalProperties, it returns the correct type of ComposedSchema.
incorrectly returns MapSchema as the type of the above schema instance for fruit.
correctly returns ComposedSchema as the type of the above schema instance for fruit
Requested change:
When additionalProperties is included in a composed schema, please return an instance of ComposedSchema which includes additionalProperties info.