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

Ability to alter OperationID #22

Open
MarkySparky opened this issue Apr 26, 2018 · 1 comment
Open

Ability to alter OperationID #22

MarkySparky opened this issue Apr 26, 2018 · 1 comment

Comments

@MarkySparky
Copy link

I have multiple methods per function for some of my lambdas. i.e. I have a GET, PATCH and DELETE in one lambda (due to Amazon limitation of about 35 endpoints per service (each endpoint generated several cloud formation items, and it's bursting to 200 limit AWS set))

usersId:
  handler: serverless/lambdas/usersId.main
  name: users-${self:provider.stage}-${self:service}-usersId
  events:
    - http:
        id: getUsersId
        method: get
        path: 'users/{userId}'
        documentation: ${file(./serverless/serverless.docs.yml):endpoints.getUsersId}
    - http:
        id: patchUsersId
        method: patch
        path: 'users/{userId}'
        documentation: ${file(./serverless/serverless.docs.yml):endpoints.patchUsersId}
    - http:
        method: delete
        path: 'users/{userId}'
        documentation: ${file(./serverless/serverless.docs.yml):endpoints.deleteUsersId}

Currently, operationId is generated from the lambda name, in this case usersId - this applies to all my endpoints in the one lambda file.

I'd like to specify it in the docs section for each method so that I dont get an error stating I cant have duplicate operationIds. i.e.

patchUsersId:
    operationId: patchUsersId
    tags:
      - users
    pathParams:
      - name: userId
        description: The userid for the current user
        schema:
          type: "string"
          pattern: "^[-a-z0-9_]+$"
    summary: "Patch a user by their users_id"
    description: "Patch a user by their users_id, handles not found"
    requestModels:
        application/json: patchUpdateUserRequest
    methodResponses:
      - statusCode: 200
        responseBody:
          description: Response
        responseModels:
          application/json: EmptyResponse
@willtan930
Copy link

I'd like to utilize a single lambda for multiple API operations, thereby having a single pool that can service all operations rather than multiple lambda pools (for improved utilization of lambdas in AWS and maintaining a number to be kept warm). This issue prevents the generation of OpenAPI docs in the Jenkins pipeline.

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

2 participants