Are `PathItemObject` and `ReferenceObject` not correctly defined?
monolithed opened this issue · comments
lib/TypeConverter.ts:44:36 - error TS2339: Property 'content' does not exist on type 'ReferenceObject | ResponseObject'.
Property 'content' does not exist on type 'ReferenceObject'.
44 content = response.content;
~~~~~~~
node_modules/openapi3-ts/src/model/OpenApi.ts:84:9 - error TS2322: Type 'undefined' is not assignable to type 'PathItemObject'.
84 return undefined;
~~~~~~~~~~~~~~~~~
{
"openapi3-ts": "^1.1.0",
"typescript": "^3.2.2",
}
➜ node -v
v10.15.0
Are PathItemObject
and ReferenceObject
not correctly defined?
For the example you provide, I don't see any problem on the definition.
-
For the first error you report:
Property 'content' does not exist on type 'ReferenceObject | ResponseObject'. Property 'content' does not exist on type 'ReferenceObject'.
That the property content is only available inResponseObject
. Instead of accessing directly to the property, you need to ensure if it is aReferenceObject
. If so: resolve it to a ResponseObject, and then access thecontent
property. -
For the second one (for the line numbered 84) looks like you are calling:
getPath()
function:
This one callsisValidExtension()
. Just ensure your extension points uses the prefixx-
.
Closing this issue as nothing need to be fixed so far. Feel free to reopen if you found an specific bug.