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

Error in generated swagger operationId #1025

Open
mastersilv3r opened this issue Oct 19, 2024 · 0 comments
Open

Error in generated swagger operationId #1025

mastersilv3r opened this issue Oct 19, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@mastersilv3r
Copy link
Contributor

mastersilv3r commented Oct 19, 2024

Version Information

latest

Current Behavior

1. In case when the event schema does not have operationId, id or summary, then the method and endpoint are used in generating the autocalculated operationId
  IN this case, in the output, there are two underscore __ set in operationId of generated swagger document.
   for ex. get__helloworld
2. But when there is a summary, then the first space character of the summary text is replaced with _, but remaining are not

Because of this, the graphql service start is failing.

Expected Behavior

  1. Generated operationId from method and endpoint should be get_helloworld (a single _)
  2. Generated operationId from summary should have all spaces replaced by as many _

Steps to Reproduce

  1. checkout the autogenerated docs/swagger.json file in your godspeed project

Screenshots or Screencast

image
2.
image

Possible Solutions or Workarounds

Fix swagger.ts in gs-node-service

Earlier

  `operationId: eventSchema.operationId || eventSchema.id || eventSchema.summary?.replaceAll(' ', '_') || `${method}_${apiEndPoint}`.replace(/\//g, '_'),`

Notice the _ between `${method}_${apiEndPoint}

Fix

  `operationId: eventSchema.operationId || eventSchema.id || eventSchema.summary?.replaceAll(' ', '_') || `${method}${apiEndPoint}`.replace(/\//g, '_'),`
@mastersilv3r mastersilv3r added the bug Something isn't working label Oct 19, 2024
@mastersilv3r mastersilv3r self-assigned this Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant