SwaggerHub CORS Error
I am facing CORS related error. The CORS has been configured on the server side. However when i try to execute an endpoint from SwaggerHUB. I get the below error
I have installed a chrome extension to disable cors and this works fine. I need to make it work without any chrome extension. What changes i have to do in my OAS file.
Here is the endpoint definition in OAS.
/api/login:
post:
tags:
- Login
summary: User login
description: Authenticate a user and generate a JWT token for authentication.
operationId: login
parameters:
- name: "x-api-key"
in: "header"
required: false
schema:
type: "string"
requestBody:
description: User credentials
required: true
content:
application/json:
schema:
properties:
email:
type: string
format: email
example: itei.test6@gmail.com
password:
type: string
format: password
example: '123456789'
company_id:
type: string
format: company_id
example: 17
type: object