Skip to content

Conversation

@newtork
Copy link
Contributor

@newtork newtork commented Aug 9, 2024

Please find similar setting names in the original OpenAPI generator.

Usage:

  • In additionalProperties define modelsToGenerate and apisToGenerate. Use <space> or , as delimiter.
<plugin>
  <groupId>com.sap.cloud.sdk.datamodel</groupId>
  <artifactId>openapi-generator-maven-plugin</artifactId>
  <configuration>
    <additionalProperties>
      <apisToGenerate>Sodas,Orders</apisToGenerate>
      <modelsToGenerate>
        Order
        OrderWithTimestamp
        Soda
        SodaWithId
      </modelsToGenerate>
    </additionalProperties>

Note:

  • To enable the generation of file SodasApi.java, the apisToGenerate field should contain Sodas (without suffix),
  • If apisToGenerate is not defined, all APIs are allowed. Same with modelsToGenerate.

Definition of Done

  • Functionality scope stated & covered
  • Tests cover the scope above
  • Error handling created / updated & covered by the tests above
  • Documentation updated
  • Release notes updated

@newtork newtork added do not merge Pull request must not be merged please review Request to review a pull request labels Aug 9, 2024
@newtork newtork marked this pull request as draft August 9, 2024 19:23
@newtork
Copy link
Contributor Author

newtork commented Sep 23, 2024

Moved stale PR to personal fork.

@newtork newtork closed this Sep 23, 2024
@newtork newtork reopened this Dec 17, 2024
a-d added 2 commits December 17, 2024 11:33
…s-and-models

# Conflicts:
#	datamodel/openapi/openapi-generator/src/main/java/com/sap/cloud/sdk/datamodel/openapi/generator/GenerationConfigurationConverter.java
@newtork newtork marked this pull request as ready for review December 17, 2024 10:34
@newtork newtork added please merge Request to merge a pull request and removed do not merge Pull request must not be merged labels Dec 17, 2024
MatKuhr
MatKuhr previously approved these changes Dec 18, 2024
Copy link
Member

@MatKuhr MatKuhr left a comment

Choose a reason for hiding this comment

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

generally lgtm. However, allow-list is not ideal for our purposes. E.g. for orchestration we already have 47 files, and typically we would want to only exclude a few files from generation.

Did you check the options for block-list? Maybe using .openapi-generator-ignore can be made to work?

version: 1.0.0
description: API for managing sodas in a soda store
paths:
/sodas:
Copy link
Member

Choose a reason for hiding this comment

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

(minor) since there is only one API, this only tests that NotExist doesn't cause the generation to fail..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't understand the implication of this statement

@newtork newtork added please review Request to review a pull request and removed please review Request to review a pull request please merge Request to merge a pull request labels Jan 6, 2025
a-d and others added 2 commits January 29, 2025 09:44
…elGeneratorIntegrationTest/generate-models/input/sodastore.yaml

Co-authored-by: Matthias Kuhr <[email protected]>
Copy link
Contributor Author

@newtork newtork left a comment

Choose a reason for hiding this comment

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

After realizing the allow/block-listing of model classes leads to non-compileable code, I'm hesitant to introduce this feature. I feel like we need to go back to the drawing board.

@newtork newtork added do not merge Pull request must not be merged and removed please review Request to review a pull request labels Jan 29, 2025
@newtork newtork closed this Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not merge Pull request must not be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants