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

Examples don't work, possible bug #25

Open
piersmacdonald opened this issue Jul 11, 2018 · 5 comments
Open

Examples don't work, possible bug #25

piersmacdonald opened this issue Jul 11, 2018 · 5 comments

Comments

@piersmacdonald
Copy link

piersmacdonald commented Jul 11, 2018

The serverless.docs.yml and serverless.yml duplicate the same documentation and it's not clear which was used to generate the openapi.yml in the directory.

When I run the sample my createUser endpoint fails to create a requestBody , I can't replicate the openapi.yml in the test/project directory. If I run the serverless.yml in the sample I get this in my output

    post:
      operationId: createUser
      summary: Create User
      description: Creates a user and then sends a generated password email
      responses:
        '201':
          description: A user object along with generated API Keys
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PutDocumentResponse'
        '500':
          description: An error message when creating a new user
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'```

Without this I'm not sure if there's a reason I can't add a request body to an endpoint
@piersmacdonald piersmacdonald changed the title Examples don't work Examples don't work, possible bug Jul 11, 2018
@pig800509
Copy link

+1

@David-Sellen
Copy link

There is a bug since #16 which ignores request body and path parameters which is solved by PR #24.

@pig800509
Copy link

@David-Sellen I don't see it is solved by now, which version do you use?
I run serverless openapi generate -o swagger.json -f json
and this is path of swagger.json

"paths": {
    "/create": {
      "post": {
        "operationId": "createUser",
        "summary": "Create User",
        "description": "Creates a user and then sends a generated password email",
        "responses": {
          "201": {
            "description": "A user object along with generated API Keys",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PutDocumentResponse"
                }
              }
            }
          },
          "500": {
            "description": "An error message when creating a new user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  }

@David-Sellen
Copy link

@pig800509 that is because the fix has not been merged into this repo

@pig800509
Copy link

@David-Sellen
I see, thank you so much.

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

3 participants