Skip to content

Adding servers option #43

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

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
node_modules
/npm-*
/build
.coverage
.directory
.DS_STORE*
Expand Down
8 changes: 8 additions & 0 deletions build/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
charset = "utf-8"
6 changes: 6 additions & 0 deletions build/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
/npm-*
.coverage
.directory
.DS_STORE*
*.log
1 change: 1 addition & 0 deletions build/.node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6
6 changes: 6 additions & 0 deletions build/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
**/__tests__/**
.*
tslint.json
tsconfig.json
jest.config.js
yarn.lock
21 changes: 21 additions & 0 deletions build/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
language: node_js
node_js: ["6"]

install:
- yarn install

script:
- yarn lint
- yarn build
- yarn test:build
- DEBUG=true yarn test:coverage

before_deploy:
- echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > ~/.npmrc

deploy:
- provider: script
skip_cleanup: true
script: npm run release
on:
tags: true
38 changes: 38 additions & 0 deletions build/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.4.0][] - 2018-04-04

- Various changes

## [0.3.0][] - 2017-08-30

### Changed

- Plugin now generates OpenAPI documentation with a version of `3.0.0` instead of `3.0.0-RC2`.
- Operation now supports `deprecated` and `tags` properties.
- Parameters now support the `content` property.
- Updated various build dependencies.
- OpenAPI definition will now be smaller in most cases, choosing to omit optional properties instead of using empty defaults.

### Fixed

- Handle when `models` is not iterable.
- Handle when `models` have no `schema`.
- Always lowercase the HTTP method to conform to OpenAPI spec.

## [v0.2.1] - 2017-07-07

Last release prior to CHANGELOG being added.


[Unreleased]: https://github.com/temando/serverless-openapi-documentation/compare/v0.4.0...HEAD
[0.4.0]: https://github.com/temando/serverless-openapi-documentation/compare/v0.4.0...v0.4.0
[0.4.0]: https://github.com/temando/serverless-openapi-documentation/compare/v0.3.0...v0.4.0
[0.3.0]: https://github.com/temando/serverless-openapi-documentation/tree/v0.3.0
54 changes: 54 additions & 0 deletions build/DefinitionGenerator.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { IDefinition, IDefinitionConfig, IServerlessFunctionConfig } from './types';
export declare class DefinitionGenerator {
version: string;
definition: IDefinition;
config: IDefinitionConfig;
/**
* Constructor
* @param serviceDescriptor IServiceDescription
*/
constructor(config: IDefinitionConfig);
parse(): this;
validate(): {
valid: boolean;
context: string[];
warnings: any[];
error?: any[];
};
/**
* Add Paths to OpenAPI Configuration from Serverless function documentation
* @param config Add
*/
readFunctions(config: IServerlessFunctionConfig[]): void;
/**
* Cleans schema objects to make them OpenAPI compatible
* @param schema JSON Schema Object
*/
private cleanSchema(schema);
/**
* Generate Operation objects from the Serverless Config.
*
* @link https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/3.0.0.md#operationObject
* @param funcName
* @param documentationConfig
*/
private getOperationFromConfig(funcName, documentationConfig);
/**
* Derives Path, Query and Request header parameters from Serverless documentation
* @param documentationConfig
*/
private getParametersFromConfig(documentationConfig);
/**
* Derives request body schemas from event documentation configuration
* @param documentationConfig
*/
private getRequestBodiesFromConfig(documentationConfig);
private attachExamples(target, config);
/**
* Gets response bodies from documentation config
* @param documentationConfig
*/
private getResponsesFromConfig(documentationConfig);
private getResponseContent(response);
private getHttpEvents(funcConfig);
}
Loading