@api-platform/api-doc-parser
Advanced tools
Comparing version 0.16.3 to 0.16.4
@@ -138,2 +138,7 @@ import { __awaiter } from "tslib"; | ||
} | ||
const url = get(entrypoint, `[0]["${property["@id"]}"][0]["@id"]`); | ||
if (!url) { | ||
console.error(new Error(`Unable to find the URL for "${property["@id"]}" in the entrypoint, make sure your API resource has at least one GET collection operation declared.`)); | ||
continue; | ||
} | ||
// Add fields | ||
@@ -224,6 +229,2 @@ const relatedClass = findRelatedClass(docs, property); | ||
} | ||
const url = get(entrypoint, `[0]["${property["@id"]}"][0]["@id"]`); | ||
if (!url) { | ||
throw new Error(`Unable to find the URL for "${property["@id"]}" in the entrypoint, make sure your API resource has at least one GET collection operation declared.`); | ||
} | ||
const resource = new Resource(guessNameFromUrl(url, entrypointUrl), url, { | ||
@@ -230,0 +231,0 @@ id: relatedClass["@id"], |
{ | ||
"name": "@api-platform/api-doc-parser", | ||
"version": "0.16.3", | ||
"version": "0.16.4", | ||
"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": [ |
@@ -247,2 +247,3 @@ import jsonld from "jsonld"; | ||
) as ExpandedRdfProperty | undefined; | ||
if (!property) { | ||
@@ -252,2 +253,15 @@ continue; | ||
const url = get(entrypoint, `[0]["${property["@id"]}"][0]["@id"]`) as | ||
| string | ||
| undefined; | ||
if (!url) { | ||
console.error( | ||
new Error( | ||
`Unable to find the URL for "${property["@id"]}" in the entrypoint, make sure your API resource has at least one GET collection operation declared.` | ||
) | ||
); | ||
continue; | ||
} | ||
// Add fields | ||
@@ -440,11 +454,2 @@ const relatedClass = findRelatedClass(docs, property); | ||
const url = get(entrypoint, `[0]["${property["@id"]}"][0]["@id"]`) as | ||
| string | ||
| undefined; | ||
if (!url) { | ||
throw new Error( | ||
`Unable to find the URL for "${property["@id"]}" in the entrypoint, make sure your API resource has at least one GET collection operation declared.` | ||
); | ||
} | ||
const resource = new Resource( | ||
@@ -451,0 +456,0 @@ guessNameFromUrl(url, entrypointUrl), |
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
278168
7106