Skip to content

Commit

Permalink
test: add privateObject to private field test
Browse files Browse the repository at this point in the history
  • Loading branch information
ad-world committed Aug 1, 2024
1 parent 1679b17 commit 613cf51
Showing 1 changed file with 34 additions and 4 deletions.
38 changes: 34 additions & 4 deletions packages/openapi-generator/test/openapi.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3942,7 +3942,11 @@ import * as h from '@api-ts/io-ts-http';
const SampleType = t.type({
foo: t.string,
/** @private */
bar: t.string, // This should show up with x-internal
bar: t.string, // This should show up with x-internal,
/** @private */
privateObject: t.type({
privateFieldInObject: t.boolean
})
});
export const route = h.httpRoute({
Expand All @@ -3963,7 +3967,7 @@ export const route = h.httpRoute({
200: SampleType
},
});
`
`;

testCase("route with private properties in request query, params, body, and response", ROUTE_WITH_PRIVATE_PROPERTIES, {
openapi: "3.0.3",
Expand Down Expand Up @@ -4007,11 +4011,24 @@ testCase("route with private properties in request query, params, body, and resp
},
foo: {
type: 'string'
},
privateObject: {
'x-internal': true,
properties: {
privateFieldInObject: {
type: 'boolean'
}
},
required: [
'privateFieldInObject'
],
type: 'object'
}
},
required: [
'foo',
'bar'
'bar',
'privateObject'
],
type: 'object'
}
Expand Down Expand Up @@ -4043,11 +4060,24 @@ testCase("route with private properties in request query, params, body, and resp
},
foo: {
type: 'string'
},
privateObject: {
'x-internal': true,
properties: {
privateFieldInObject: {
type: 'boolean'
}
},
required: [
'privateFieldInObject'
],
type: 'object'
}
},
required: [
'foo',
'bar'
'bar',
'privateObject'
],
title: 'SampleType',
type: 'object'
Expand Down

0 comments on commit 613cf51

Please sign in to comment.