temando / serverless-openapi-documentation

Serverless 1.0 plugin to generate OpenAPI V3 documentation from serverless configuration
MIT License
93 stars 127 forks source link

Does this work only with AWS? #17

Closed martosoler closed 6 years ago

martosoler commented 6 years ago

Hi,

I have setup a simple hello world to test the documentation features of this plugin but it is not outputting anything for my Azure functions.

I'm starting to suspect that the plugin only works with AWS, am I right?

service: helloworld-lean-soler

provider:
  name: azure
  location: West US

plugins:
  - serverless-azure-functions
  - serverless-openapi-documentation

custom:
  documentation:
    version: '1'
    title: 'My API'
    description: 'This is my API'

functions:
  hello:
    handler: handler.hello
    events:
      - http: true
        path: hello
        documentation:
          summary: Hello
          description: Says hello gently
          methodResponses:
            - statusCode: 200
              responseBody:
                description: "OK"
        x-azure-settings:
          authLevel : anonymous
          methods:
                - get
  bye:
    handler: handler.bye
    events:
      - http: true
        path: bye
        documentation:
          summary: Bye
          description: Says bye gently
        x-azure-settings:
          authLevel : anonymous
          methods:
                - get

This is the output:

openapi: 3.0.0
components:
  schemas: {}
  securitySchemes: {}
info:
  title: My API
  description: This is my API
  version: '1'
paths: {}

Thanks

martosoler commented 6 years ago

Will close the issue, the problem seemed to be http: true in the YAML file of Serverless.

Sorry