Skip to content
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

Better handling of Inline schema #13498

Closed
wants to merge 28 commits into from
Closed

Better handling of Inline schema #13498

wants to merge 28 commits into from

Conversation

wing328
Copy link
Member

@wing328 wing328 commented Sep 22, 2022

Better handling of Inline schema based on feedback from the users.

allOf inline schemas (children) are not created by default.

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master (6.1.0) (minor release - breaking changes with fallbacks), 7.0.x (breaking changes without fallbacks)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@devhl-labs
Copy link
Contributor

devhl-labs commented Oct 22, 2022

This PR does not resolve the following:

openapi: 3.0.1
components:
  schemas:
    Language:
      type: object
      properties:
        name:
          type: string
          readOnly: true
    Clan:
      type: object
      properties:
        chatLanguage:
          # nullable: true
          allOf:
          - $ref: '#/components/schemas/Language'

image
Note the two different language classes. This was not an issue in 6.0.0 beta 914b539 Also note that the CatAllOf pointed out in the issue did exist in 6.0.0 beta. The declawed property was placed in it's own AllOf class. The AllOf class would not be needed if the declawed property were just put into the Cat model. The mustache templates shouldn't even need changing. I think the issues here are related to #13709

image

@wing328 wing328 modified the milestones: 6.2.1, 6.3.0 Nov 1, 2022
@@ -75,12 +73,10 @@ part 'serializers.g.dart';
ArrayTest,
Capitalization,
Cat,
CatAllOf,$CatAllOf,
Copy link
Contributor

@ahmednfwela ahmednfwela Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking at the dart samples in
https://github.com/OpenAPITools/openapi-generator/tree/inline-schema-improve3/samples/openapi3/client/petstore/dart-dio

I see that the inline model files still remain but their reference is removed here

what might be causing this ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wing328 wing328 modified the milestones: 6.4.0, 6.5.0 Feb 19, 2023
@wing328 wing328 modified the milestones: 6.5.0, 6.6.0 Apr 1, 2023
@wing328 wing328 modified the milestones: 6.6.0, 7.0.0 May 11, 2023
@wing328
Copy link
Member Author

wing328 commented May 30, 2023

UPDATE: started a new PR (#15682) using a different approach

@wing328 wing328 closed this May 30, 2023
@wing328 wing328 deleted the inline-schema-improve3 branch June 11, 2023 07:38
@wing328
Copy link
Member Author

wing328 commented Jun 11, 2023

UPDAT: #15682 has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement: General Inline Schema Handling Schema contains a complex schema in items/additionalProperties/allOf/oneOf/anyOf
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants