datamodel-code-generator
datamodel-code-generator copied to clipboard
Json pointer encoding
Describe the bug
When referencing paths from another file with json pointer encoding according to RFC-6901 or url encoding, Models not found in the input data is outputted.
To Reproduce
openapi.yaml:
openapi: 3.0.1
info:
title: "pass"
version: ""
paths:
# events
/test/subscribe:
$ref: "evts.yaml#/paths/~1test~1test"
evts.yaml:
openapi: 3.0.1
info:
title: evts
description: evts
version: "0.0.0"
tags:
- name: evts
description: |
evts
paths:
/test/test:
post:
operationId: evts
description: |
evts
tags:
- Events
parameters: []
requestBody:
content:
application/json:
schema:
type: object
responses:
default:
description: ""
callbacks:
test:
'{$url}':
post:
requestBody:
description: ""
required: true
content:
application/json:
schema:
"$ref": "#/components/schemas/Sample"
responses:
default:
description: ""
components:
schemas:
Sample:
description: Sample
type: object
properties:
sample:
type: string
Used commandline:
$ datamodel-codegen --input openapi.yaml --input-file-type openapi --openapi-scopes paths
Expected behavior Generation of models.
Version:
- OS: Ubuntu 22.04
- Python version: 3.10
- datamodel-code-generator version: 0.22.0