I am trying to generate an API client for Nestjs using this openapi definition. However openapi-generator-cli report lots of missing content fields, here are a few examples:
[[nestjs-generator] ./hapi-fhir-openapi.yaml] -attribute paths.'/ExampleScenario'(get).parameters.[status].content is missing
[[nestjs-generator] ./hapi-fhir-openapi.yaml] -attribute paths.'/MedicinalProductPharmaceutical'(get).parameters.[_filter].content is missing
[[nestjs-generator] ./hapi-fhir-openapi.yaml] -attribute paths.'/Account/{id}/$diff'(get).parameters.[to].content is missing
[[nestjs-generator] ./hapi-fhir-openapi.yaml] -attribute paths.'/Organization/{id}/$validate'(get).parameters.[resource].content is missing
[[nestjs-generator] ./hapi-fhir-openapi.yaml] -attribute paths.'/VerificationResult'(get).parameters.[_id].content is missing
[[nestjs-generator] ./hapi-fhir-openapi.yaml] -attribute paths.'/StructureMap/{id}/$diff'(get).parameters.[to].content is missing
[[nestjs-generator] ./hapi-fhir-openapi.yaml] -attribute paths.'/AppointmentResponse'(get).parameters.[_id].content is missing
[[nestjs-generator] ./hapi-fhir-openapi.yaml] -attribute paths.'/EffectEvidenceSynthesis'(get).parameters.[_tag].content is missing
[[nestjs-generator] ./hapi-fhir-openapi.yaml] -attribute paths.'/ImmunizationRecommendation'(get).parameters.[_tag].content is missing
[[nestjs-generator] ./hapi-fhir-openapi.yaml] -attribute paths.'/SearchParameter/{id}/$diff'(get).parameters.[from].content is missing
Here is the openapitools.json that I am using:
{
"$schema": "/home/myname/.nvm/versions/node/v14.15.0/lib/node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "6.0.1",
"generators": {
"nestjs-generator": {
"generatorName": "typescript-nestjs",
"output": "./output",
"inputSpec": "./hapi-fhir-openapi.yaml",
"additionalProperties": {
"npmName": "hapi-fhir-api",
"nestVersion": "8.0.0"
}
}
}
}
}
I also tried using version 6.1.0 and 6.2.0 and other typescript generators, but the errors remain.
As Postman manages to correctly import all api paths correctly from the definition I don't understand why these content fields are mandatory in openapi-generator. Is there a way to ignore or skip missing fields?