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

Replace 5XX to actual errors #7

Open
paunin opened this issue Dec 4, 2023 · 1 comment
Open

Replace 5XX to actual errors #7

paunin opened this issue Dec 4, 2023 · 1 comment

Comments

@paunin
Copy link

paunin commented Dec 4, 2023

Some Swagger generting clients treat status code as integer and hence unexpect to see 5XX as string. Example here

Think it's even safe to skip those errors in the annotations

@paunin
Copy link
Author

paunin commented Dec 4, 2023

#fireblocks-api-additions.yml 
paths:
  '/vault/accounts/{vaultAccountId}/{assetId}/max_spendable_amount':
    get:
      summary: Get Spendable Balance
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/MaxSpendableAmount'
        default:
          $ref: '#/components/responses/Error'
components:
  schemas:
    TransactionOperation:
      enum:
        - ENABLE_ASSET
    MaxSpendableAmount:
      type: object
      properties:
        maxSpendableAmount:
          type: string
    TransactionSubStatus:
      enum:
        - REJECTED_BY_USER
        - NONCE_ALLOCATION_FAILED
        - PENDING_BLOCKCHAIN_CONFIRMATIONSREJECTED_BY_USER
        - ''
    TransactionResponse:
      properties:
        addressType:
          enum:
            - ''
        subStatus:
          type: string
# subStatus is something that changes too often on Fireblocks Side - so we just make it string
yq eval-all '(select(fileIndex == 0)
  | del(.components.schemas.TransactionResponse.properties.subStatus.$ref)
  | del(.paths.*.*.responses.5XX)
  | .style="double"
) *+ select(fileIndex == 1)' fireblocks-api.yml fireblocks-api-additions.yml > fireblocks-result.yml

Thats's the patch we do to make client work BTW

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