-
-
Notifications
You must be signed in to change notification settings - Fork 226
Support references to non-object types #371
New issue
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
Comments
@p1-alexandrevaney I don't think I understand the example spec. components:
schemas:
Link:
type: object
properties:
href:
Uri:
type: string Shouldn't |
The real world example is this: https://github.com/jdegre/5GC_APIs/blob/master/TS29571_CommonData.yaml#L296
It has a ref to https://github.com/jdegre/5GC_APIs/blob/master/TS29571_CommonData.yaml#L182
So i figured it should be resolved to
A simpler example would be to just have
During the generation, the type=string will be ignored and the model will be
|
Ah, our reference resolution is pretty barebones right now and I think only supports references to objects (not basic types), so that's probably the issue. |
No one should try to do this until #366 is done though, since that big rework of reference resolution will conflict with anything else related. |
][#425]. Thanks @p1-ra! * parser / properties / do not restrict reference pointer type to `enum` or `object` * e2e / update `openapi.json` and golden-record * tpl / model / add missing typing import: `Tuple,Optional,BinaryIO,TextIO` * test: Make big ref test model properties required to lessen generated code Co-authored-by: Nementon <[email protected]>
…-generators#371][openapi-generators#418][openapi-generators#425]. Thanks @p1-ra! * parser / properties / do not restrict reference pointer type to `enum` or `object` * e2e / update `openapi.json` and golden-record * tpl / model / add missing typing import: `Tuple,Optional,BinaryIO,TextIO` * test: Make big ref test model properties required to lessen generated code Co-authored-by: Nementon <[email protected]>
Describe the bug
root component schemas do not get parsed correctly, resolved to None
To Reproduce
Steps to reproduce the behavior:
openapi-python-client generate --path path_to_test.yaml
Expected behavior
The generated model Link should have
href: Union[Unset, str] = UNSET
as attributeinstead we have
href: Union[Unset, None] = UNSET
OpenAPI Spec File
Desktop (please complete the following information):
Additional context
I am trying to build a 5g stack with the open source 5g api. This file in particular contains a lot of components schemas that get resolved to None
https://github.com/jdegre/5GC_APIs/blob/master/TS29571_CommonData.yaml
For example the
Uri
components is translated towhich does not seem right as it is only a
type:string
componentThe text was updated successfully, but these errors were encountered: