Expected Behaviour
Hi and thank you for the great library! I like how it's written and works very stable. Good work!
I try to use ResolvingParser for my custom OpenAPI code generator. The problem is when it resolves references it doesn't keep the referenced schema name in the output spec. Is it possible to provide original schema name to the output or access it somehow with the minimal effort? Or maybe put the name to some custom OpenAPI extension field similar to x-enum-varnames or use existing field (e.g. title)?
{
"openapi": "3.0.2",
"info": {
"title": "Demo",
"version": "1.0"
},
"paths": {
"/demo": {
"get": {
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"x-schema-name": "SampleModel",
"type": "string"
}
}
}
}
}
}
}
}
}
Minimal Example Spec
api.yml
openapi: '3.0.2'
info:
title: Demo
version: '1.0'
paths:
/demo:
get:
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: 'demo.yml#/components/schemas/SampleModel'
demo.yml
components:
schemas:
SampleModel:
type: string
Actual Behaviour
{
"openapi": "3.0.2",
"info": {
"title": "Demo",
"version": "1.0"
},
"paths": {
"/demo": {
"get": {
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "string"
}
}
}
}
}
}
}
}
}
Steps to Reproduce
Run prance compile api.yml output.json
Environment
- OS: Fedora 37
- Python version: 3.11.2
- Swagger/OpenAPI version used: 3.0.2
- Backend: openapi-spec-validator
Expected Behaviour
Hi and thank you for the great library! I like how it's written and works very stable. Good work!
I try to use
ResolvingParserfor my custom OpenAPI code generator. The problem is when it resolves references it doesn't keep the referenced schema name in the output spec. Is it possible to provide original schema name to the output or access it somehow with the minimal effort? Or maybe put the name to some custom OpenAPI extension field similar tox-enum-varnamesor use existing field (e.g.title)?{ "openapi": "3.0.2", "info": { "title": "Demo", "version": "1.0" }, "paths": { "/demo": { "get": { "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "x-schema-name": "SampleModel", "type": "string" } } } } } } } } }Minimal Example Spec
api.yml
demo.yml
Actual Behaviour
{ "openapi": "3.0.2", "info": { "title": "Demo", "version": "1.0" }, "paths": { "/demo": { "get": { "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "string" } } } } } } } } }Steps to Reproduce
Run
prance compile api.yml output.jsonEnvironment