Ask a Question

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

stan1
New Member

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!

1 REPLY 1
ponelat
Staff

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`? 

cancel
Showing results for 
Search instead for 
Did you mean: