Skip to content

Conversation

newtork
Copy link
Contributor

@newtork newtork commented Feb 25, 2025

Context

https://github.com/SAP/ai-sdk-java-backlog/issues/170

We want to have the option to have low-memory-footprint float[] instead of verbose List<BigDecimal> in generated code.

Unfortunately there is no convenience API or plugin property or CLI argument to serve this feature.

Feature scope:

  • When encountering a property of type array with item type number (not integer!), then generate float[]
    • Feature toggle, for internal use

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 changed the title feat: OpenAPI to support float[] over List<BigDecimal> feat: OpenAPI Generator to support float[] over List<BigDecimal> Feb 26, 2025
a-d and others added 3 commits February 26, 2025 10:49
…elGeneratorIntegrationTest/openai-2024-10-21/output/com/sap/cloud/sdk/services/openai/api/DefaultApi.java
…d/sdk/datamodel/openapi/generator/DataModelGeneratorIntegrationTest.java
Comment on lines +63 to +64
@JsonProperty("embedding")
private float[] embedding;
Copy link
Contributor Author

@newtork newtork Feb 26, 2025

Choose a reason for hiding this comment

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

For comparison, without feature toggle:

@JsonProperty("embedding")
private List<BigDecimal> embedding = new ArrayList<>();

@newtork newtork added the please review Request to review a pull request label Feb 26, 2025
a-d and others added 5 commits February 27, 2025 14:32
…f-bigdecimal-list

# Conflicts:
#	datamodel/openapi/openapi-generator/src/main/java/com/sap/cloud/sdk/datamodel/openapi/generator/GenerationConfigurationConverter.java
#	datamodel/openapi/openapi-generator/src/main/java/com/sap/cloud/sdk/datamodel/openapi/generator/GeneratorCustomProperties.java
#	datamodel/openapi/openapi-generator/src/test/java/com/sap/cloud/sdk/datamodel/openapi/generator/DataModelGeneratorIntegrationTest.java
#	datamodel/openapi/openapi-generator/src/test/resources/DataModelGeneratorIntegrationTest/api-class-for-ai-sdk/output/com/sap/cloud/sdk/services/builder/model/Soda.java
…l-list' into float-array-instead-of-bigdecimal-list
rpanackal
rpanackal previously approved these changes Feb 28, 2025
Copy link
Member

@rpanackal rpanackal left a comment

Choose a reason for hiding this comment

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

LGTM

@newtork newtork enabled auto-merge (squash) February 28, 2025 12:17
@newtork newtork merged commit 8b64143 into main Feb 28, 2025
14 checks passed
@newtork newtork deleted the float-array-instead-of-bigdecimal-list branch February 28, 2025 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
please review Request to review a pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants