We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The GitHub openapi spec contains a commit object which contains an inner commit object.
commit
When I generate a client using the Python generator only the inner commit object is generated
$ docker run --rm openapitools/openapi-generator-cli:latest --version openapi-generator-cli 7.9.0-SNAPSHOT commit : ca378b4 built : -999999999-01-01T00:00:00+18:00 source : https://github.com/openapitools/openapi-generator docs : https://openapi-generator.tech/
Here's the full GitHub openapi spec and here's the relevant snippet
"commit": { "title": "Commit", "description": "Commit", "type": "object", "properties": { ... "commit": { "type": "object", "properties": { "url": { "type": "string", "format": "uri", "example": "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e" }, "author": { "$ref": "#/components/schemas/nullable-git-user" }, "committer": { "$ref": "#/components/schemas/nullable-git-user" }, "message": { "type": "string", "example": "Fix all the bugs" }, "comment_count": { "type": "integer", "example": 0 }, "tree": { "type": "object", "properties": { "sha": { "type": "string", "example": "827efc6d56897b048c772eb4087f854f46256132" }, "url": { "type": "string", "format": "uri", "example": "https://api.github.com/repos/octocat/Hello-World/tree/827efc6d56897b048c772eb4087f854f46256132" } }, "required": [ "sha", "url" ] }, "verification": { "$ref": "#/components/schemas/verification" } }, "required": [ "author", "committer", "comment_count", "message", "tree", "url" ] }, ...
docker run --rm -v /tmp:/local openapitools/openapi-generator-cli:latest generate \ --input-spec https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.2022-11-28.json \ --generator-name python \ --output /local
cat /tmp/openapi_client/models/commit.py
I suggest including the outer name in the name of nested objects - in this case the inner class would be named CommitCommit
CommitCommit
The text was updated successfully, but these errors were encountered:
to have complete control of inline schema naming, please refer to https://github.com/openapitools/openapi-generator/blob/master/docs/customization.md#inline-schema-naming
Sorry, something went wrong.
Thanks @wing328
No branches or pull requests
Bug Report Checklist
Description
The GitHub openapi spec contains a
commit
object which contains an innercommit
object.When I generate a client using the Python generator only the inner
commit
object is generatedopenapi-generator version
OpenAPI declaration file content or url
Here's the full GitHub openapi spec and here's the relevant snippet
Generation Details
Steps to reproduce
cat /tmp/openapi_client/models/commit.py
Suggest a fix
I suggest including the outer name in the name of nested objects - in this case the inner class would be named
CommitCommit
The text was updated successfully, but these errors were encountered: