@api-platform/api-doc-parser
Advanced tools
Comparing version 0.14.1 to 0.14.2
@@ -5,3 +5,2 @@ "use strict"; | ||
var tslib_1 = require("tslib"); | ||
var openapi_types_1 = require("openapi-types"); | ||
var json_refs_1 = tslib_1.__importDefault(require("json-refs")); | ||
@@ -155,21 +154,11 @@ var lodash_get_1 = tslib_1.__importDefault(require("lodash.get")); | ||
resource.operations = tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray([], (showOperation | ||
? [ | ||
buildOperationFromPathItem(openapi_types_1.OpenAPIV3.HttpMethods.GET, "show", showOperation), | ||
] | ||
? [buildOperationFromPathItem("get", "show", showOperation)] | ||
: []), true), (editOperation | ||
? [ | ||
buildOperationFromPathItem(openapi_types_1.OpenAPIV3.HttpMethods.PUT, "edit", editOperation), | ||
] | ||
? [buildOperationFromPathItem("put", "edit", editOperation)] | ||
: []), true), (deleteOperation | ||
? [ | ||
buildOperationFromPathItem(openapi_types_1.OpenAPIV3.HttpMethods.DELETE, "delete", deleteOperation), | ||
] | ||
? [buildOperationFromPathItem("delete", "delete", deleteOperation)] | ||
: []), true), (listOperation | ||
? [ | ||
buildOperationFromPathItem(openapi_types_1.OpenAPIV3.HttpMethods.GET, "list", listOperation), | ||
] | ||
? [buildOperationFromPathItem("get", "list", listOperation)] | ||
: []), true), (createOperation | ||
? [ | ||
buildOperationFromPathItem(openapi_types_1.OpenAPIV3.HttpMethods.POST, "create", createOperation), | ||
] | ||
? [buildOperationFromPathItem("post", "create", createOperation)] | ||
: []), true); | ||
@@ -176,0 +165,0 @@ if (listOperation && listOperation.parameters) { |
import { __awaiter } from "tslib"; | ||
import { OpenAPIV3 } from "openapi-types"; | ||
import jsonRefs from "json-refs"; | ||
@@ -144,25 +143,15 @@ import get from "lodash.get"; | ||
...(showOperation | ||
? [ | ||
buildOperationFromPathItem(OpenAPIV3.HttpMethods.GET, "show", showOperation), | ||
] | ||
? [buildOperationFromPathItem("get", "show", showOperation)] | ||
: []), | ||
...(editOperation | ||
? [ | ||
buildOperationFromPathItem(OpenAPIV3.HttpMethods.PUT, "edit", editOperation), | ||
] | ||
? [buildOperationFromPathItem("put", "edit", editOperation)] | ||
: []), | ||
...(deleteOperation | ||
? [ | ||
buildOperationFromPathItem(OpenAPIV3.HttpMethods.DELETE, "delete", deleteOperation), | ||
] | ||
? [buildOperationFromPathItem("delete", "delete", deleteOperation)] | ||
: []), | ||
...(listOperation | ||
? [ | ||
buildOperationFromPathItem(OpenAPIV3.HttpMethods.GET, "list", listOperation), | ||
] | ||
? [buildOperationFromPathItem("get", "list", listOperation)] | ||
: []), | ||
...(createOperation | ||
? [ | ||
buildOperationFromPathItem(OpenAPIV3.HttpMethods.POST, "create", createOperation), | ||
] | ||
? [buildOperationFromPathItem("post", "create", createOperation)] | ||
: []), | ||
@@ -169,0 +158,0 @@ ]; |
{ | ||
"name": "@api-platform/api-doc-parser", | ||
"version": "0.14.1", | ||
"version": "0.14.2", | ||
"description": "Transform an API documentation (Hydra, OpenAPI, GraphQL) in an intermediate representation that can be used for various tasks such as creating smart API clients, scaffolding code or building administration interfaces.", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -98,3 +98,3 @@ import { OpenAPIV3 } from "openapi-types"; | ||
const buildOperationFromPathItem = ( | ||
httpMethod: OpenAPIV3.HttpMethods, | ||
httpMethod: `${OpenAPIV3.HttpMethods}`, | ||
operationName: string, | ||
@@ -186,45 +186,15 @@ pathItem: OpenAPIV3.OperationObject | ||
...(showOperation | ||
? [ | ||
buildOperationFromPathItem( | ||
OpenAPIV3.HttpMethods.GET, | ||
"show", | ||
showOperation | ||
), | ||
] | ||
? [buildOperationFromPathItem("get", "show", showOperation)] | ||
: []), | ||
...(editOperation | ||
? [ | ||
buildOperationFromPathItem( | ||
OpenAPIV3.HttpMethods.PUT, | ||
"edit", | ||
editOperation | ||
), | ||
] | ||
? [buildOperationFromPathItem("put", "edit", editOperation)] | ||
: []), | ||
...(deleteOperation | ||
? [ | ||
buildOperationFromPathItem( | ||
OpenAPIV3.HttpMethods.DELETE, | ||
"delete", | ||
deleteOperation | ||
), | ||
] | ||
? [buildOperationFromPathItem("delete", "delete", deleteOperation)] | ||
: []), | ||
...(listOperation | ||
? [ | ||
buildOperationFromPathItem( | ||
OpenAPIV3.HttpMethods.GET, | ||
"list", | ||
listOperation | ||
), | ||
] | ||
? [buildOperationFromPathItem("get", "list", listOperation)] | ||
: []), | ||
...(createOperation | ||
? [ | ||
buildOperationFromPathItem( | ||
OpenAPIV3.HttpMethods.POST, | ||
"create", | ||
createOperation | ||
), | ||
] | ||
? [buildOperationFromPathItem("post", "create", createOperation)] | ||
: []), | ||
@@ -231,0 +201,0 @@ ]; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
374038
8146