Skip to content

Generated discriminator uses full path instead of relative #59

Description

@Sholto

For example, the following code

    AddVoucherResult:
      oneOf:
        - $ref: '#/components/schemas/AddVoucherSuccess'
        - $ref: '#/components/schemas/AddVoucherFailure'
      discriminator:
        propertyName: valid
        mapping:
          true: '#/components/schemas/AddVoucherSuccess'
          false: '#/components/schemas/AddVoucherFailure'

    AddVoucherFailure:
      type: object
      required:
        - valid
      properties:
        valid:
          type: boolean
        reasonForFailure:
          type: string

    VoucherValidationResult:
      type: object
      required:
        - valid
      properties:
        valid:
          type: boolean
        reasonForFailure:

Yields the following:

                discriminator:
                  propertyName: valid
                  mapping:
                    "true": /Users/sholto/Development/taxicharge-pass/api/frag/voucher.yml#/components/schemas/AddVoucherSuccess
                    "false": /Users/sholto/Development/taxicharge-pass/api/frag/voucher.yml#/components/schemas/AddVoucherFailure

As can be seen, the path is the full path location rather than the relative one that is used elsewhere.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions