Skip to content

requestBody and requestModels not being generated. #34

@mike-van

Description

@mike-van

i try to follow the example in the documentation. But i cant get the requestBody, and requestModels to generated in the documentation file.

service: hasuraLambda # NOTE: update this with your service name

provider:
  name: aws
  runtime: nodejs8.10
  stage: ekyc-testing
  region: ap-southeast-1
custom:
  documentation:
    version: '1.0.0'
    title: 'EKMC API'
    description: 'This APIs are EKYC and EKYM service serve for client.'
    models:
      - name: SuccessResponse
        contentType: "application/json"
        schema:
          $schema: "http://json-schema.org/draft-04/schema#"
          type: object
          properties:
            statusCode:
              type: integer
            message:
              type: string
            body:
              type: object
      - name: FailureResponse
        contentType: "application/json"
        schema:
          $schema: "http://json-schema.org/draft-04/schema#"
          type: object
          properties:
            statusCode:
              type: integer
            message:
              type: string
            body:
              type: object
      - name: EkycPostRequest
        contentType: "application/json"
        schema:
          $schema: "http://json-schema.org/draft-04/schema#"
          type: object
          properties:
            firstName:
              type: string
            lastName:
              type: string
            status:
              type: string
functions:
  ekyc-post:
    handler: functions/Ekyc/post.handler
    events:
      - http:
          path: ekyc
          method: post
          documentation:
            tags: ['ekyc']
            summary: "Post new record to server."
            requestBody:
              description: "Can insert an empty object. This will still create a new record inside the server."
            requestModels:
              application/json: "EkycPostRequest"
            methodResponses:
              - statusCode: '200'
                responseBody:
                  description: "Successfully created new ekyc record in server."
                responseModels:
                  application/json: SuccessResponse
              - statusCode: '500'
                responseBody:
                  description: "Can't create new ekyc record in server."
                responseModels:
                  application/json: FailureResponse
plugins:
  - serverless-offline
  - serverless-mocha-plugin
  - serverless-openapi-documentation

im not sure what went wrong. but the responseModels work just fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions