File tree Expand file tree Collapse file tree 8 files changed +30
-1
lines changed Expand file tree Collapse file tree 8 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ export interface Model extends Schema {
8
8
base : string ;
9
9
template : string | null ;
10
10
link : Model | null ;
11
+ title : string | null ;
11
12
description : string | null ;
12
13
deprecated ?: boolean ;
13
14
default ?: string ;
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export const getModel = (
22
22
base : 'any' ,
23
23
template : null ,
24
24
link : null ,
25
+ title : definition . title || null ,
25
26
description : definition . description || null ,
26
27
deprecated : definition . deprecated === true ,
27
28
isDefinition,
@@ -62,12 +63,14 @@ export const getModel = (
62
63
if ( definition . enum && definition . type !== 'boolean' ) {
63
64
const enumerators = getEnum ( definition . enum ) ;
64
65
const extendedEnumerators = extendEnum ( enumerators , definition ) ;
66
+
65
67
if ( extendedEnumerators . length ) {
66
68
model . export = 'enum' ;
67
69
model . type = 'string' ;
68
70
model . base = 'string' ;
69
71
model . enum . push ( ...extendedEnumerators ) ;
70
72
model . default = getModelDefault ( definition , model ) ;
73
+
71
74
return model ;
72
75
}
73
76
}
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ export const getModelProperties = (
36
36
| 'properties'
37
37
> = {
38
38
name : escapeName ( propertyName ) ,
39
+ title : property . title || null ,
39
40
description : property . description || null ,
40
41
deprecated : property . deprecated === true ,
41
42
isDefinition : false ,
Original file line number Diff line number Diff line change 9
9
{{ #if isNullable }}
10
10
isNullable: {{{ isNullable }}} ,
11
11
{{ /if }}
12
+ {{ #if enum }}
13
+ enums: [
14
+ {{ #each enum }}
15
+ {
16
+ name: '{{{ name }}} ',
17
+ type: '{{{ type }}} ',
18
+ value: {{{ value }}} ,
19
+ },
20
+ {{ /each }}
21
+ ],
22
+ {{ /if }}
12
23
}
Original file line number Diff line number Diff line change 2
2
{{ #if type }}
3
3
type: '{{{ type }}} ',
4
4
{{ /if }}
5
+ {{ #if title }}
6
+ title: `{{{ escapeDescription title }}} `,
7
+ {{ /if }}
5
8
{{ #if description }}
6
9
description: `{{{ escapeDescription description }}} `,
7
10
{{ /if }}
Original file line number Diff line number Diff line change 1
1
{
2
+ {{ #if title }}
3
+ title: `{{{ escapeDescription title }}} `,
4
+ {{ /if }}
2
5
{{ #if description }}
3
6
description: `{{{ escapeDescription description }}} `,
4
7
{{ /if }}
Original file line number Diff line number Diff line change @@ -26,6 +26,11 @@ export const writeClientSchemas = async (
26
26
indent : Indent
27
27
) : Promise < void > => {
28
28
for ( const model of models ) {
29
+ //console.log(model)
30
+ if ( model . name === 'JaxMetaType' ) {
31
+ console . log ( model )
32
+ }
33
+
29
34
const file = resolve ( outputPath , `$${ model . name } .ts` ) ;
30
35
const templateResult = templates . exports . schema ( {
31
36
...model ,
Original file line number Diff line number Diff line change @@ -33,9 +33,11 @@ export const writeClientServices = async (
33
33
clientName ?: string
34
34
) : Promise < void > => {
35
35
for ( const service of services ) {
36
+ /*
36
37
service.operations.map(o => {
37
- console . log ( o . parametersBody )
38
+ console.log(o)
38
39
})
40
+ */
39
41
const file = resolve ( outputPath , `${ service . name } ${ postfix } .ts` ) ;
40
42
const templateResult = templates . exports . service ( {
41
43
...service ,
You can’t perform that action at this time.
0 commit comments