File tree 1 file changed +5
-2
lines changed
packages/core/src/getters
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { SchemaObject } from 'openapi3-ts/oas30' ;
2
- import { ContextSpecs , ScalarValue } from '../types' ;
2
+ import { ContextSpecs , ScalarValue , OutputClient } from '../types' ;
3
3
import { escape , isString } from '../utils' ;
4
4
import { getArray } from './array' ;
5
5
import { getObject } from './object' ;
@@ -20,7 +20,10 @@ export const getScalar = ({
20
20
name ?: string ;
21
21
context : ContextSpecs ;
22
22
} ) : ScalarValue => {
23
- const nullable = item . nullable ? ' | null' : '' ;
23
+ // NOTE: Angular client does not support nullable types
24
+ const isAngularClient = context . output . client === OutputClient . ANGULAR ;
25
+ const nullable = item . nullable && ! isAngularClient ? ' | null' : '' ;
26
+
24
27
const enumItems = item . enum ?. filter ( ( enumItem ) => enumItem !== null ) ;
25
28
26
29
if ( ! item . type && item . items ) {
You can’t perform that action at this time.
0 commit comments