-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
[Core] Added members for circular refs and container of models #4758
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
base: master
Are you sure you want to change the base?
Conversation
* added model utility to handle circular dependencies (e.g. for forward declaration) * added property isModelContainer if a container contains more models
|
I noticed that #4553 just got merged, which adds a similar functionality for a different purpose. |
getCircularReferencess to getCircularReferences
Description clarity.
…generator into improve_model_gen
|
When you've time, can you please add some tests similar to those added in #4553 ? |
|
Will do when I got some time on my hands again! |
|
Added some simple test cases, should hopefully be enough! |
| public boolean isFile; | ||
| public boolean isBoolean; | ||
| public boolean isDate; // full-date notation as defined by RFC 3339, section 5.6, for example, 2017-07-21 | ||
| public boolean isDateTime; // the date-time notation as defined by RFC 3339, section 5.6, for example, 2017-07-21T17:32:28Z |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've noticed multiple times now that this list continuously causes conflicts when only separated by spaces. Changing it to line breaks again.
Added a member
circularReferencesto CodegenModel which stores all circular referenced schemas. Created ModelUtils methodgetCircularReferencedSchemaNames()to call recursivedetectCircularReferences()to store all found circular references in a Set of strings. Set gets stored incircularReferences.Add a member flag to CodegenProperty which is true if an array schema consists of object schema items.
PR checklist
./bin/(or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run./bin/{LANG}-petstore.sh,./bin/openapi3/{LANG}-petstore.shif updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).master,4.3.x,5.0.x. Default:master.Related feature request
closes #4757
Additional context
First pull request(s), hopefully doing everything right!
technical committee
cc @OpenAPITools/generator-core-team