Open luhn opened 2 weeks ago
Interestingly if I bump the OpenAPI version to 3.1.1, it doesn't appear to have the same issue.
paths: {}
info:
title: Test
version: 1.0.0
openapi: 3.1.1
components:
schemas:
Nested:
type: object
properties:
id:
type: integer
Test:
type: object
properties:
id:
type: integer
nested:
anyOf:
- $ref: '#/components/schemas/Nested'
- type: 'null'
nested_with_description:
description: Foobar
anyOf:
- $ref: '#/components/schemas/Nested'
- type: 'null'
Thanks for reporting. Would you like to investigate this and propose a fix?
953 changed how nullable nested schemas were handled, to fix #952.
It seems that the old behavior is still present if you set a description in the metadata field.
Output:
I would expect that
nested
andnested_with_description
would be identical except for thedescription
field, but you can see thatnested_with_description
has the behavior that was deemed incorrect in #952.