@trayio/tray-openapi 4.13.0 → 4.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,6 +27,7 @@ const TE = __importStar(require("fp-ts/TaskEither"));
27
27
  const E = __importStar(require("fp-ts/Either"));
28
28
  const O = __importStar(require("fp-ts/Option"));
29
29
  const GenerateOutput_1 = require("./GenerateOutput");
30
+ const SchemaGenerator_1 = require("../SchemaGenerator");
30
31
  const generateOutputFileContents = async (responses) => {
31
32
  const operationNameCamelCase = 'CreatePost';
32
33
  const generatedOutputSchema = await (0, GenerateOutput_1.generateOutputSchema)(responses)();
@@ -45,72 +46,30 @@ describe('Generate output: ', () => {
45
46
  description: 'A post was created',
46
47
  content: O.some({
47
48
  'application/json': {
48
- schema: O.some({
49
+ schema: O.some((0, SchemaGenerator_1.generateNonArraySchemaObject)({
49
50
  title: O.some('Post'),
50
51
  type: O.some('object'),
51
52
  required: O.some(['id', 'userId', 'title', 'body']),
52
53
  properties: O.some({
53
- id: {
54
- title: O.none,
54
+ id: (0, SchemaGenerator_1.generateNonArraySchemaObject)({
55
55
  type: O.some('integer'),
56
- properties: O.none,
57
- required: O.none,
58
56
  additionalProperties: O.some(false),
59
- allOf: O.none,
60
- anyOf: O.none,
61
- oneOf: O.none,
62
- not: O.none,
63
- in: O.none,
64
- default: O.none,
65
- },
66
- userId: {
67
- title: O.none,
57
+ }),
58
+ userId: (0, SchemaGenerator_1.generateNonArraySchemaObject)({
68
59
  type: O.some('integer'),
69
- properties: O.none,
70
- required: O.none,
71
60
  additionalProperties: O.some(false),
72
- allOf: O.none,
73
- anyOf: O.none,
74
- oneOf: O.none,
75
- not: O.none,
76
- in: O.none,
77
- default: O.none,
78
- },
79
- title: {
80
- title: O.none,
61
+ }),
62
+ title: (0, SchemaGenerator_1.generateNonArraySchemaObject)({
81
63
  type: O.some('string'),
82
- properties: O.none,
83
- required: O.none,
84
64
  additionalProperties: O.some(false),
85
- allOf: O.none,
86
- anyOf: O.none,
87
- oneOf: O.none,
88
- not: O.none,
89
- in: O.none,
90
- default: O.none,
91
- },
92
- body: {
93
- title: O.none,
65
+ }),
66
+ body: (0, SchemaGenerator_1.generateNonArraySchemaObject)({
94
67
  type: O.some('string'),
95
- properties: O.none,
96
- required: O.none,
97
68
  additionalProperties: O.some(false),
98
- allOf: O.none,
99
- anyOf: O.none,
100
- oneOf: O.none,
101
- not: O.none,
102
- in: O.none,
103
- default: O.none,
104
- },
69
+ }),
105
70
  }),
106
71
  additionalProperties: O.some(false),
107
- allOf: O.none,
108
- anyOf: O.none,
109
- oneOf: O.none,
110
- not: O.none,
111
- in: O.none,
112
- default: O.none,
113
- }),
72
+ })),
114
73
  },
115
74
  }),
116
75
  },
@@ -131,72 +90,29 @@ describe('Generate output: ', () => {
131
90
  description: 'A post was created',
132
91
  content: O.some({
133
92
  'application/json': {
134
- schema: O.some({
135
- title: O.none,
93
+ schema: O.some((0, SchemaGenerator_1.generateNonArraySchemaObject)({
136
94
  type: O.some('object'),
137
95
  required: O.some(['id', 'userId', 'title', 'body']),
138
96
  properties: O.some({
139
- id: {
140
- title: O.none,
97
+ id: (0, SchemaGenerator_1.generateNonArraySchemaObject)({
141
98
  type: O.some('integer'),
142
- properties: O.none,
143
- required: O.none,
144
99
  additionalProperties: O.some(false),
145
- allOf: O.none,
146
- anyOf: O.none,
147
- oneOf: O.none,
148
- not: O.none,
149
- in: O.none,
150
- default: O.none,
151
- },
152
- userId: {
153
- title: O.none,
100
+ }),
101
+ userId: (0, SchemaGenerator_1.generateNonArraySchemaObject)({
154
102
  type: O.some('integer'),
155
- properties: O.none,
156
- required: O.none,
157
103
  additionalProperties: O.some(false),
158
- allOf: O.none,
159
- anyOf: O.none,
160
- oneOf: O.none,
161
- not: O.none,
162
- in: O.none,
163
- default: O.none,
164
- },
165
- title: {
166
- title: O.none,
104
+ }),
105
+ title: (0, SchemaGenerator_1.generateNonArraySchemaObject)({
167
106
  type: O.some('string'),
168
- properties: O.none,
169
- required: O.none,
170
107
  additionalProperties: O.some(false),
171
- allOf: O.none,
172
- anyOf: O.none,
173
- oneOf: O.none,
174
- not: O.none,
175
- in: O.none,
176
- default: O.none,
177
- },
178
- body: {
179
- title: O.none,
108
+ }),
109
+ body: (0, SchemaGenerator_1.generateNonArraySchemaObject)({
180
110
  type: O.some('string'),
181
- properties: O.none,
182
- required: O.none,
183
111
  additionalProperties: O.some(false),
184
- allOf: O.none,
185
- anyOf: O.none,
186
- oneOf: O.none,
187
- not: O.none,
188
- in: O.none,
189
- default: O.none,
190
- },
112
+ }),
191
113
  }),
192
114
  additionalProperties: O.some(false),
193
- allOf: O.none,
194
- anyOf: O.none,
195
- oneOf: O.none,
196
- not: O.none,
197
- in: O.none,
198
- default: O.none,
199
- }),
115
+ })),
200
116
  },
201
117
  }),
202
118
  },
@@ -5,5 +5,6 @@ export declare const JsonSchemaToTypescriptOptions: {
5
5
  singleQuote: boolean;
6
6
  useTabs: boolean;
7
7
  };
8
+ additionalProperties: boolean;
8
9
  };
9
10
  //# sourceMappingURL=JsonSchemaToTypescriptOptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"JsonSchemaToTypescriptOptions.d.ts","sourceRoot":"","sources":["../../../src/file-generators/types/JsonSchemaToTypescriptOptions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B;;;;;;;CAOzC,CAAC"}
1
+ {"version":3,"file":"JsonSchemaToTypescriptOptions.d.ts","sourceRoot":"","sources":["../../../src/file-generators/types/JsonSchemaToTypescriptOptions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B;;;;;;;;CAQzC,CAAC"}
@@ -8,4 +8,5 @@ exports.JsonSchemaToTypescriptOptions = {
8
8
  singleQuote: true,
9
9
  useTabs: true,
10
10
  },
11
+ additionalProperties: false,
11
12
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trayio/tray-openapi",
3
- "version": "4.13.0",
3
+ "version": "4.15.0",
4
4
  "description": "Creating CDK Projects from OpenAPI 3.0 Schemas",
5
5
  "exports": {
6
6
  "./*": "./dist/*.js"