All properties generated by the openapi-generator are defined with ?: e.g.
/**
* Gets or sets the angle of reflection.
*/
angle?: number;
expected:
/**
* Gets or sets the angle of reflection.
*/
angle: number;
4.3.1
https://gist.github.com/Dunkhan/604694e5ae47c1162f784f1d3f3a78b9
npx openapi-generator generate -i D:\Work\testApi.json -g typescript-angular -c ./generate.api.options.json -o dist/api
generate options:
{
"npmName": "my-api",
"ngVersion": "9.1.0",
"fileNaming": "kebab-case",
"apiModulePrefix": "myPrefix"
}
Run the command
Look in the file
\dist\api\modeleffect-angle-values.ts
none found
I am fully aware I might be doing something wrong, missing a flag, or reporting an intended behaviour. Please help me out if this is the case by explaining how I can get the generator to generate without the ?
I tried the flag nullSafeAdditionalProps but I found that this simply added "| null" to all nullable properties. This is good and I intend to keep using it but it does not solve the problem.
The reason this is an issue is that it I wish to use strict type checking and the properties being potentially undefined means that I have to fill all my code with undefined checks. These properties should never be undefined.
馃憤 Thanks for opening this issue!
馃彿 I have applied any labels matching special text in your issue.
The team will review the labels and make any necessary changes.
Your schema must be wrong. Required/optional fields are supported and tested for.
In the example schema
parameters:
- name: status
in: query
description: Status values that need to be considered for filter
required: true
type: array
items:
type: string
enum:
- available
- pending
- sold
default: available
it generates correct output

add required: true
@agilob I don't know how the tests look, but they are wrong. By definition nullable is false by default(https://swagger.io/specification/)! Yet not setting nullable at all treats nullable as true.
Most helpful comment
@agilob I don't know how the tests look, but they are wrong. By definition nullable is false by default(https://swagger.io/specification/)! Yet not setting nullable at all treats nullable as true.