Skip to content

Commit d0f7e23

Browse files
committed
test: add privateObject to private field test
DX-613
1 parent b678013 commit d0f7e23

File tree

1 file changed

+34
-4
lines changed

1 file changed

+34
-4
lines changed

packages/openapi-generator/test/openapi.test.ts

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3942,7 +3942,11 @@ import * as h from '@api-ts/io-ts-http';
39423942
const SampleType = t.type({
39433943
foo: t.string,
39443944
/** @private */
3945-
bar: t.string, // This should show up with x-internal
3945+
bar: t.string, // This should show up with x-internal,
3946+
/** @private */
3947+
privateObject: t.type({
3948+
privateFieldInObject: t.boolean
3949+
})
39463950
});
39473951
39483952
export const route = h.httpRoute({
@@ -3963,7 +3967,7 @@ export const route = h.httpRoute({
39633967
200: SampleType
39643968
},
39653969
});
3966-
`
3970+
`;
39673971

39683972
testCase("route with private properties in request query, params, body, and response", ROUTE_WITH_PRIVATE_PROPERTIES, {
39693973
openapi: "3.0.3",
@@ -4007,11 +4011,24 @@ testCase("route with private properties in request query, params, body, and resp
40074011
},
40084012
foo: {
40094013
type: 'string'
4014+
},
4015+
privateObject: {
4016+
'x-internal': true,
4017+
properties: {
4018+
privateFieldInObject: {
4019+
type: 'boolean'
4020+
}
4021+
},
4022+
required: [
4023+
'privateFieldInObject'
4024+
],
4025+
type: 'object'
40104026
}
40114027
},
40124028
required: [
40134029
'foo',
4014-
'bar'
4030+
'bar',
4031+
'privateObject'
40154032
],
40164033
type: 'object'
40174034
}
@@ -4043,11 +4060,24 @@ testCase("route with private properties in request query, params, body, and resp
40434060
},
40444061
foo: {
40454062
type: 'string'
4063+
},
4064+
privateObject: {
4065+
'x-internal': true,
4066+
properties: {
4067+
privateFieldInObject: {
4068+
type: 'boolean'
4069+
}
4070+
},
4071+
required: [
4072+
'privateFieldInObject'
4073+
],
4074+
type: 'object'
40464075
}
40474076
},
40484077
required: [
40494078
'foo',
4050-
'bar'
4079+
'bar',
4080+
'privateObject'
40514081
],
40524082
title: 'SampleType',
40534083
type: 'object'

0 commit comments

Comments
 (0)