Skip to content

feat: Add errorUnions feature testing endpoint#30

Closed
bflad wants to merge 1 commit intomainfrom
bflad/gen-1461-feature-support-errorunions-feature-in-php
Closed

feat: Add errorUnions feature testing endpoint#30
bflad wants to merge 1 commit intomainfrom
bflad/gen-1461-feature-support-errorunions-feature-in-php

Conversation

@bflad
Copy link
Copy Markdown
Member

@bflad bflad commented May 22, 2025

@linear
Copy link
Copy Markdown

linear bot commented May 22, 2025

@bflad
Copy link
Copy Markdown
Member Author

bflad commented May 22, 2025

Turns out the other /errors/{status_code} endpoint can already work for this -- so if you see this you're probably looking for the errors-union-of-errors and errors-union-of-errors-discriminated tests and this OAS

  /errors/500#errorUnion:
    servers:
      - url: http://localhost:35456
    post:
      operationId: errorUnionPost
      tags:
        - errors
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  x-speakeasy-name-override: errorType1RequestBody
                  properties:
                    error:
                      type: string
                  required:
                    - error
                - type: object
                  x-speakeasy-name-override: errorType2RequestBody
                  properties:
                    error:
                      type: object
                      x-speakeasy-name-override: errorType2Message
                      properties:
                        message:
                          type: string
                      required:
                        - message
      responses:
        "200":
          description: OK
        "500":
          $ref: "components.yaml#/components/responses/errorUnionResponse"
  /errors/400#errorUnionDiscriminated:
    servers:
      - url: http://localhost:35456
    post:
      operationId: errorUnionDiscriminatedPost
      tags:
        - errors
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  x-speakeasy-name-override: taggedError1RequestBody
                  properties:
                    tag:
                      type: string
                    error:
                      type: string
                  required:
                    - tag
                    - error
                - type: object
                  x-speakeasy-name-override: taggedError2RequestBody
                  properties:
                    tag:
                      type: string
                    error:
                      type: object
                      x-speakeasy-name-override: taggedError2Message
                      properties:
                        message:
                          type: string
                      required:
                        - message
                  required:
                    - tag
                    - error
      responses:
        "200":
          description: OK
        "4XX":
          $ref: "components.yaml#/components/responses/errorUnionDiscriminatedResponse"

@bflad bflad closed this May 22, 2025
@bflad bflad deleted the bflad/gen-1461-feature-support-errorunions-feature-in-php branch May 22, 2025 18:20
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 this pull request may close these issues.

1 participant