feathersjs-ecosystem / feathers-swagger

Add documentation to your FeatherJS services and feed them to Swagger UI.
MIT License
226 stars 63 forks source link

Bug: Custom method definitions are effecting other methods #248

Closed AshotN closed 1 year ago

AshotN commented 1 year ago

Describe the bug I have a user service with a few custom methods. If I try to add docs for the custom methods it overwrites the user POST method and

To Reproduce

  docs: {
        operations: {
          verifySignupToken: {
            description: 'Verifies the users email address by form of long or short token',
            'parameters[0]': {
              description: 'Long version of token, would be embedded in a link',
              in: 'query',
              name: 'longToken',
              example: '75e69439-99e3-4179-abed-312914a15a1f',
              schema: {
                type: 'string'
              }
            },
            'parameters[1]': {
              description: 'Short version of token, would be included in email',
              in: 'query',
              name: 'shortToken',
              example: 'R5SIK0',
              schema: {
                type: 'string'
              }
            }
          },
          verifyResetToken: {
            description: 'Verifies the users request for a password reset by form of long or short token',
            'parameters[0]': {
              description: 'Long version of token, would be embedded in a link',
              in: 'query',
              name: 'longToken',
              example: '75e69439-99e3-4179-abed-312914a15a1f',
              schema: {
                type: 'string'
              }
            },
            'parameters[1]': {
              description: 'Short version of token, would be included in email',
              in: 'query',
              name: 'shortToken',
              example: 'R5SIK0',
              schema: {
                type: 'string'
              }
            },
            'parameters[2]': {
              in: 'query',
              name: 'newPassword',
              schema: {
                type: 'string'
              }
            }
          }
        },
        securities: enabledMethods
      }
    })

image

Here for example it get's the correct description but the incorrect params image

System configuration Tell us about the applicable parts of your setup.

Mairu commented 1 year ago

Should be fixed in 3.0.0-pre.1