Git Product home page Git Product logo

serverless-openapi-documentation's People

Contributors

brendo avatar chrisgerrish avatar deadarius avatar denis-sokolov avatar hassankhan avatar lwcooper avatar medikoo avatar mikeralphson avatar nfour avatar orthanc avatar wrumsby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

serverless-openapi-documentation's Issues

Root level tags are not transferred to the resulting config

I have custom/documentation section of serverless.yml defined as follows:

version: ...
title: ...
description: ...
tags:
  - name: public
    description: API endpoints not requiring authentication
  - name: user-level
  - name: ...
models:
  - ...

with ... being properly replaced to meaningful values. After compilation I don't see tags section in the resulting openapi.yml file on the root level.

Note: function-level tags definition are properly transferred.

Required fields in the schema are not being validated

In the property documentation/models/schema I'm pointing to a JSON schema file of the object supposed to be sent in the request body:

models:
    - schema: ${file(models/test.json)}
      name: 'Tester'
      description: 'Esquema Tester Object'
      contentType: 'application/json'

Even though I declared some required fields in the schema, the object is sent when those fields are absent. The request shouldn't be executed successfully under that scenario.

It works properly if I also declare the schema in the serverless.yml (functions/events/Http/request):

events:
      - http:
          path: /tester
          method: post
          integration: lambda
          request:
            schema:
              application/json: ${file(models/test.json)}
            template:
              application/json: $input.json('$')
          documentation: ${file(my-project-api.doc.yml):endpoints.tester}

But that configuration is not desirable since I have to set the request schema in two places, so the risk to break things in big/complex projects are very high.

test schema with some required fields:

{
  "definitions": {},
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Test",
  "description": "Tester",
  "type": "object",
  "required": [ "age", "name" ],
  "properties": {

    "name": {
      "type": "string",
      "description": "names"
    },
    "age" : {
      "type": "integer",
      "description": "age"
    },
    "is": {
      "type": "boolean",
      "description": "type"
    }
  }
}

Support for securitySchemes

Copy of an issue from original repo posted by @ecolman

Original text:

Is there any way to have the securitySchemes picked up through the config? I took a look at the code, but it seems like the securitySchemes is always set to {}. Using a token based header to validate the user.

https://github.com/temando/serverless-openapi-documentation/blob/master/src/DefinitionGenerator.ts#L42

Original issue: temando#20

Support for HttpApi

This plugin doesn't seem to support HttpApi, i.e.

functions:
list:
handler: src/handler.list
events:
- httpApi:
path: /subject
method: GET
documentation: ${file(documentation.yml):endpoints.list}

Just gets ignored when generating docs. Are there plans to support it?

Configure travis to publish prerelease

  • travis deploy needs to be updated
  • two deploy jobs - release @latest and release @next
  • @latest (npm publish) should be released on tags matching only tags of format v<Maj>.<Minor>.<Patch>, such asv1.0.0
  • @next ( npm publish --tag next) should be released on tags matching only tags of format v<Maj>.<Minor>.<Patch>-<Prerelease>, such asv1.0.0-alpha or v1.0.0-1

Related travis documentation:

Simplify build and deploy

  • rename build folder to dist
  • ship source alongside dist
  • no longer cd into a build folder to publish
  • include proper main entry in package.json

Consistent schema support for headers and parameters

Currently headers and parameters only support schema defined in serverless file or json schema imported using serverless ${file(<json-schema>)} syntax.

Need to add support for importing schemas by specifying a path

Schema validation question.

I cant thank enough every single collaborator in this fork. We started using serverless a few months ago and this was one of the last pieces of the puzzle.

My only concern is the schema-validation inside of AWS works with this package ? or do we still have to use serverless-aws-documentation to validate everything ?

Thanks.

Include this plugin with other core plugins

I am trying to use the tag - 1.1.0 along with other plugins in my serverless.yml file.

plugins:
  - serverless-domain-manager
  - serverless-plugin-typescript
  - serverless-dynamodb-local
  - serverless-prune-plugin
  - serverless-offline
  - @conqua/serverless-openapi-documentation

Error:

  Serverless Error ---------------------------------------
 
  Serverless plugin "@conqua/serverless-openapi-documentation" not found. Make sure it's installed and listed in the "plugins" section of your serverless config file.

I also tried installing the plugin using my package.json and referencing using the localPath options for plugins

plugins:
- localPath: './node_modules/@conqua/serverless-openapi-documentation'
- modules:
  - serverless-domain-manager
  - serverless-plugin-typescript
  - serverless-dynamodb-local
  - serverless-prune-plugin
  - serverless-offline

But I receive the below error :

Type Error ---------------------------------------------
 
  TypeError: [object Object] is not a string
      at module.exports (/Users/chetanpawar/Work-Related/kubernetes/kube-deploy-dir/helm/organizational-socialization/node_modules/type/lib/resolve-exception.js:12:8)

I tried executing the below command with both ways :

serverless openapi generate -o openapi.yaml

Can anyone help here to specify the right option to use this fork of the plugin to work with the other core plugins ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.