Skip to content

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

@blakew

Description

@blakew

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions