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

Interfaces without a mutable member do not generate Put or MergePatch schema objects #8

Open
blakew opened this issue Apr 19, 2022 · 0 comments

Comments

@blakew
Copy link

blakew commented Apr 19, 2022

Interfaces without a mutable member do not generate a Put or a MergePatch component, but they do create the references to them, producing invalid spec.

Reproducible example:

    TargetOptions:
      description: |
        The export target configuration options. These vary by connection type.
      discriminator:
        propertyName: connection_type
      oneOf:
        - $interface: "TargetOptionsBigQuery#SameAsInterface"
        - $interface: "TargetOptionsHostedApi#SameAsInterface"
        - $interface: "TargetOptionsHostedCsv#SameAsInterface"
        - $interface: "TargetOptionsRedshift#SameAsInterface"
        - $interface: "TargetOptionsS3Csv#SameAsInterface"

...

    TargetOptionsHostedApi:
      description: "Hosted API publication target configuration options."
      members:
        connection_type:
          required: true
          initializable: true
          mutable: false
          schema:
            const: hosted_api
            type: string

this produces:

TargetOptionsMergePatch:
      oneOf:
        - $ref: "#/components/schemas/TargetOptionsBigQueryMergePatch"
        - $ref: "#/components/schemas/TargetOptionsHostedApiMergePatch"
        - $ref: "#/components/schemas/TargetOptionsHostedCsvMergePatch"
        - $ref: "#/components/schemas/TargetOptionsRedshiftMergePatch"
        - $ref: "#/components/schemas/TargetOptionsS3CsvMergePatch"
      discriminator:
        propertyName: connection_type

...

    TargetOptionsPut:
      oneOf:
        - $ref: "#/components/schemas/TargetOptionsBigQueryPut"
        - $ref: "#/components/schemas/TargetOptionsHostedApiPut"
        - $ref: "#/components/schemas/TargetOptionsHostedCsvPut"
        - $ref: "#/components/schemas/TargetOptionsRedshiftPut"
        - $ref: "#/components/schemas/TargetOptionsS3CsvPut"
      discriminator:
        propertyName: connection_type

However, neither TargetOptionsHostedApiPut nor TargetOptionsHostedApiMergePatch are generated.

@blakew blakew changed the title Interfaces without a mutable member do not generate a Put Interfaces without a mutable member do not generate a Put or MergePatch schema object Apr 21, 2022
@blakew blakew changed the title Interfaces without a mutable member do not generate a Put or MergePatch schema object Interfaces without a mutable member do not generate Put or MergePatch schema objects Apr 21, 2022
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

No branches or pull requests

1 participant