-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
[Feat][Typescript Angular] Implement deepObject query params (OAS3.0) #21108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
f5aa790
696442c
810f2ad
b5472b6
d2a06dd
1da1551
0b5ac7f
537263f
f75ecd4
4ae6fa3
8d2cd3f
71629f8
0ae6902
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
generatorName: typescript-angular | ||
outputDir: samples/client/petstore/typescript-angular-v16-provided-in-root/builds/deep-object | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how about having it in the newest angular version, so it doesnt get lost when deleting older versions? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Happy to. I took your comment here too literally. |
||
inputSpec: modules/openapi-generator/src/test/resources/3_0/deep-object-query.yaml | ||
templateDir: modules/openapi-generator/src/main/resources/typescript-angular | ||
additionalProperties: | ||
ngVersion: 16.1.2 | ||
supportsES6: true | ||
enumNameMappings: | ||
delivered: SHIPPED |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -464,4 +464,29 @@ public void testEnumAsConst() throws IOException { | |
assertThat(fileContents).containsOnlyOnce("} as const;"); | ||
assertThat(fileContents).doesNotContain(" as Type"); | ||
} | ||
|
||
@Test | ||
public void testDeepObject() throws IOException { | ||
// GIVEN | ||
final String specPath = "src/test/resources/3_0/deepobject.yaml"; | ||
|
||
File output = Files.createTempDirectory("test").toFile(); | ||
output.deleteOnExit(); | ||
|
||
// WHEN | ||
final CodegenConfigurator configurator = new CodegenConfigurator() | ||
.setGeneratorName("typescript-angular") | ||
.setInputSpec(specPath) | ||
.setOutputDir(output.getAbsolutePath().replace("\\", "/")); | ||
|
||
final ClientOptInput clientOptInput = configurator.toClientOptInput(); | ||
|
||
Generator generator = new DefaultGenerator(); | ||
generator.opts(clientOptInput).generate(); | ||
|
||
// THEN | ||
final String fileContents = Files.readString(Paths.get(output + "/api/default.service.ts")); | ||
assertThat(fileContents).containsOnlyOnce("<any>options, 'options', true);"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are these assertions related to the deepObject case? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the last parameter is |
||
assertThat(fileContents).containsOnlyOnce("<any>inputOptions, 'inputOptions', true);"); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Increased Node version as tests were failing due to Angular refusing to compile on NodeJS versions <18. Node 18 is required for all currently supported Angular versions (docs).