Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Issue when using different directory such as src #821

Closed
5 tasks done
Emt-tz opened this issue Oct 14, 2023 · 1 comment
Closed
5 tasks done

Issue when using different directory such as src #821

Emt-tz opened this issue Oct 14, 2023 · 1 comment

Comments

@Emt-tz
Copy link

Emt-tz commented Oct 14, 2023

Bug descrition

#When default root path is set to src

"paths": {
      "@/*": [
        "./src/*"
      ]
    },

Swagger does not load the api routes even when annotated but when i move my code out of src directory then swagger does display

Reproduction

use src directory as main file directory for the apis

System Info

macos ventura 13.2

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@jellydn
Copy link
Owner

jellydn commented Oct 18, 2023

Could you provide the reproduce repository? You would see that we could define the path for api routes.

const spec: Record<string, any> = createSwaggerSpec({
    apiFolder: 'pages/api' // or 'src/pages/api', ==> You could change the folder here
    definition: {
      openapi: '3.0.0',
      info: {
        title: 'Next Swagger API Example',
        version: '1.0',
      },
    },
  });

Repository owner locked and limited conversation to collaborators Oct 18, 2023
@jellydn jellydn converted this issue into discussion #827 Oct 18, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants