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

Model properties that are both string and enum breaks csharp client generation #56

Closed
bobend opened this issue Jul 6, 2023 · 1 comment · May be fixed by #57
Closed

Model properties that are both string and enum breaks csharp client generation #56

bobend opened this issue Jul 6, 2023 · 1 comment · May be fixed by #57

Comments

@bobend
Copy link

bobend commented Jul 6, 2023

Fx:

        model:
          description: ID of the model to use. You can use the `text-davinci-edit-001` or `code-davinci-edit-001` model with this endpoint.
          type: string
          example: "text-davinci-edit-001"
          anyOf:
            - type: string
            - type: string
              enum: ["text-davinci-edit-001","code-davinci-edit-001"]

This example also have an additional type: string and breaks RicoSuter/NSwag

Could it be changed to:

        model:
          description: ID of the model to use. You can use the `text-davinci-edit-001` or `code-davinci-edit-001` model with this endpoint.
          example: "text-davinci-edit-001"
          type: string
          enum: ["text-davinci-edit-001","code-davinci-edit-001"]

without breaking compatibles with other language client generators?

@schnerd
Copy link
Collaborator

schnerd commented Sep 1, 2023

The anyOf type is done on purpose – customers sometimes need to pass fine-tuned models into the SDKs which are arbitrary strings, but we also want to provide autocomplete suggestions for publicly documented models. The SDK generator will need to be updated to support this.

@schnerd schnerd closed this as completed Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants