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

Fetch Error: Internal Server Error #79

Open
pradip-interra opened this issue Aug 16, 2021 · 0 comments
Open

Fetch Error: Internal Server Error #79

pradip-interra opened this issue Aug 16, 2021 · 0 comments

Comments

@pradip-interra
Copy link

In my project my intention is to configure fastify-swagger with OpenAPI version 3.0.0 with the following configuration:

I am using fastify-oas as fastify plugin such that my existing configuration does not need to alter.

const swaggerConfig = {
    swagger: {
      info: {
        title: `${constants.SERVICE_NAME.toUpperCase()} swagger`,
        description: `NetApp ${constants.SERVICE_NAME.toUpperCase()} service API.`,
        version: '1.0.0'
      },
      externalDocs: {
        url: 'https://swagger.io',
        description: 'Find more info here'
      },
      schemes: [`${schema}`],
      consumes: ['application/json'],
      produces: ['application/json'],
      tags: [
        { name: 'persistence', description: 'foo' },
        { name: 'index', description: 'bar'}
      ],
      securityDefinitions: {
        Authorization_Token: {
            type: 'apiKey',
            name: 'Authorization',
            in: 'header'
        }
      }
    },
    exposeRoute: true,
    routePrefix: `${constants.EXTERNAL_PATH}/api-docs`
};

fastify.register(require('fastify-oas'), swaggerConfig );

Actually I was trying to following the following link here (https://github.com/fastify/fastify-swagger/blob/master/examples/dynamic-openapi.js).

However somehow I am not able to succeed, always it shows the error that it's not able to load the swagger. Not seeing any error in the console. The error is like below screen shot:

enter image description here

Any clue how can I debug would be helpful how can I proceed with debugging this.

One interesting point is: as I am removing arbitrarily some portion of the schema just to see if I can pin point by trial and error, it's start working!

So if there a way to bit systematically debug it, would be great.

Thanks,
Pradip

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