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

Discriminator Inference Regression: Specification working with 1.1.1 no longer works in 1.2.x #1255

Closed
silvestre opened this issue May 28, 2024 · 0 comments · Fixed by #1263
Labels
bug Something isn't working

Comments

@silvestre
Copy link

What version of ogen are you using?

Working: 1.1.1
Not working: 1.2.0, 1.2.1

Can this issue be reproduced with the latest version?

Yes

What did you do?

We run in cloudfoundry/app-autoscaler-release via generate.go

go run github.com/ogen-go/ogen/cmd/ogen --config ogen-config.yaml --package scalinghistory --target scalinghistory --clean ../../../../api/scaling-history-api.openapi.yaml

with the config just being:

parser:
  allow_remote: true

and the OpenAPI spec scaling-history-api.openapi.yaml, containing the following schemas:

    HistoryEntry:
      description: "Properties common for each entry in the scaling history."
      type: object
      oneOf:
        - $ref: "#/components/schemas/HistoryErrorEntry"
        - $ref: "#/components/schemas/HistoryIgnoreEntry"
        - $ref: "#/components/schemas/HistorySuccessEntry"
      properties:
       [... many shared properties, e.g.]
        message:
          type: string
          description: Textual information about the scaling event.
          example: app
    HistoryErrorEntry:
      description: Description of a failed scaling even in history.
      type: object
      properties:
        error:
          type: string
          description: |
            In case the scaling failed, the reason is provided in this field.
          example: failed to compute new app instances
    HistoryIgnoreEntry:
      description: Description of an ignored scaling event in history.
      type: object
      properties:
        ignore_reason:
          type: string
          description: |
            In case the scaling was ignored, the reason is provided in this field.
          example: app in cooldown period
    HistorySuccessEntry:
      description: Description of a successful scaling event event in history.
      type: object
      properties: {} # No extra fields needed in this variant.

What did you expect to see?

With ogen versions up to 1.1.1 client and server code was generated and has been used by us productively.

What did you see instead?

Starting with 1.2.0 we get an error message:

Feature "discriminator inference" is not implemented yet.

Try to create ogen.yml with:

generator:
        ignore_not_implemented: ["discriminator inference"]

or

generator:
        ignore_not_implemented: ["all"]

to skip unsupported operations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant