@martinsson/serverless-openapi-documentation
Advanced tools
Comparing version 1.2.3 to 1.2.4
@@ -53,5 +53,5 @@ "use strict"; | ||
this.definition.components.schemas = yield parse_1.parseModels(models, this.root); | ||
this.config.models = _.map(this.definition.components.schemas, crateModel); | ||
function crateModel(value, key) { | ||
return { name: key, contentType: 'application/json', schema: value, description: '', example: {} }; | ||
this.config.models = _.map(this.definition.components.schemas, createModel); | ||
function createModel(value, key) { | ||
return { name: key, contentType: 'application/json', schema: value }; | ||
} | ||
@@ -76,2 +76,5 @@ return this; | ||
readFunctions(config) { | ||
function normalizePath(path) { | ||
return path.startsWith('/') ? path : '/' + path; | ||
} | ||
// loop through function configurations | ||
@@ -85,3 +88,3 @@ for (const funcConfig of config) { | ||
const pathConfig = { | ||
[`/${httpEventConfig.path}`]: { | ||
[normalizePath(httpEventConfig.path)]: { | ||
[httpEventConfig.method.toLowerCase()]: this.getOperationFromConfig(funcConfig._functionName, httpEventConfig.documentation) | ||
@@ -88,0 +91,0 @@ } |
{ | ||
"name": "@martinsson/serverless-openapi-documentation", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"description": "Serverless 1.0 plugin to generate OpenAPI V3 documentation from serverless configuration", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,7 +5,7 @@ import { JSONSchema7 } from "json-schema"; | ||
name: string; | ||
description: string; | ||
description?: string; | ||
contentType: string; | ||
schema: string | JSONSchema7; | ||
examples: Array<any>; | ||
example: object; | ||
examples?: Array<any>; | ||
example?: object; | ||
} | ||
@@ -12,0 +12,0 @@ export interface DefinitionConfig { |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
59311
684
0