Forum Discussion

stan1's avatar
stan1
New Member
4 years ago

Override 403 response and make it 400 instead. Is this possible?

403:
          description: An error occurred.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    default: 400
                  message:
                    type: string
                    default: An error occurred.

So far this lead me to nothing. Help! Thanks!

  • Is there a reason you can't add the `400` status code directly? 

     

    400: # <----- 400 status
      description: An error occurred.
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: integer
                default: 400
              message:
                type: string
                default: An error occurred.

     

    Or perhaps you could expand on what use case you have? For example where do you see the `403` when you want `400`?