Describe the bug
generated class missing attributes/features when jsonschema is defined with allof + patternproperties
To Reproduce
Example schema: (in yaml)
definitions:
First:
properties:
first:
type: string
required:
- first
Second:
properties:
second:
type: string
required:
- second
Third:
patternProperties:
^([a-zA-Z][a-zA-Z0-9_]+)$:
$ref: '#/definitions/Second'
Target:
allOf:
- $ref: "#/definitions/First"
- $ref: "#/definitions/Third"
AnotherTarget:
allOf:
- $ref: "#/definitions/First"
- patternProperties:
^([a-zA-Z][a-zA-Z0-9_]+)$:
$ref: '#/definitions/Second'
Used commandline:
$ datamodel-codegen --input-file-type jsonschema --input input.yaml
generated result:
:
class First(BaseModel):
first: str
class Second(BaseModel):
second: str
class Third(BaseModel):
__root__: Dict[constr(regex=r'^([a-zA-Z][a-zA-Z0-9_]+)$'), Second]
class Target(First):
pass
class AnotherTarget(First):
pass
Expected behavior
generated class 'Target' should have attributes/features for patternProperties(#/definitions/Third) but missing.
AnotherTaget class also expected as the same as Target class.
Version:
Additional context
none.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too