-
OAS says (section 4.7.25.1 of the spec):
Example OAS: openapi: 3.0.3
info:
title: Example
version: 0.1.0
servers:
- url: http://example.com
paths:
/foo:
delete:
responses:
'200':
description: OK
components:
schemas:
Foo:
type: object
properties:
text:
type: string
default: 987
number:
type: number
Bar:
type: object
properties:
foo:
allOf:
- $ref: '#/components/schemas/Foo'
default:
text: abc
number: 123 Specification above generating following models class Foo(BaseModel):
text: Optional[str] = 987
number: Optional[float] = None
class Bar(BaseModel):
foo: Optional[Foo] = {'text': 'abc', 'number': 123} I expected something like: class Foo(BaseModel):
text: Optional[str] = 987
number: Optional[float] = None
class Bar(BaseModel):
foo: Optional[Foo] = Foo(text='abc', number=123) Why are default values used in a dict for now? Seems default values from this example should be generated as an instance of class |
Beta Was this translation helpful? Give feedback.
Answered by
koxudaxi
Jan 18, 2023
Replies: 1 comment 2 replies
-
@mtovt I'm sorry for my too-late reply. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
koxudaxi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@mtovt I'm sorry for my too-late reply.
OK, I will support the feature.
Thank you!!