Skip to content

Commit

Permalink
Fix generate open api that occurs null value in generated file (#215)
Browse files Browse the repository at this point in the history
* Fix generate open api that occurs null value in generated file

See #209

* Fix cypress tests

Interceptor need to have new resourcePath that are now fixed to be not null.
  • Loading branch information
michelu89 authored Jun 12, 2024
1 parent cd5d1c7 commit 550857c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/apps/ame-e2e/src/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -535,13 +535,13 @@ Cypress.Commands.add('saveAspectModelToWorkspace', () => {
Cypress.Commands.add('openGenerationOpenApiSpec', () => {
cy.intercept(
'POST',
'http://localhost:9091/ame/api/generate/open-api-spec?language=en&output=json&baseUrl=https://example.com&includeQueryApi=false&useSemanticVersion=false&pagingOption=NO_PAGING&resourcePath=null&ymlProperties=&jsonProperties=',
'http://localhost:9091/ame/api/generate/open-api-spec?language=en&output=json&baseUrl=https://example.com&includeQueryApi=false&useSemanticVersion=false&pagingOption=NO_PAGING&resourcePath=&ymlProperties=&jsonProperties=',
{fixture: 'valid-open-api.json'},
);

cy.intercept(
'POST',
'http://localhost:9091/ame/api/generate/open-api-spec?language=en&output=yaml&baseUrl=https://example.com&includeQueryApi=false&useSemanticVersion=false&pagingOption=NO_PAGING&resourcePath=null&ymlProperties=&jsonProperties=',
'http://localhost:9091/ame/api/generate/open-api-spec?language=en&output=yaml&baseUrl=https://example.com&includeQueryApi=false&useSemanticVersion=false&pagingOption=NO_PAGING&resourcePath=&ymlProperties=&jsonProperties=',
{fixture: 'valid-open-api.yaml'},
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export class GenerateOpenApiComponent implements OnInit, OnDestroy {
activateResourcePath: new FormControl(false),
output: new FormControl('yaml'),
paging: new FormControl('NO_PAGING'),
resourcePath: new FormControl(null),
resourcePath: new FormControl(''),
file: new FormControl(null),
ymlProperties: new FormControl(null),
jsonProperties: new FormControl(null),
Expand All @@ -129,7 +129,7 @@ export class GenerateOpenApiComponent implements OnInit, OnDestroy {
resourcePathControl?.setValue('/resource/{resourceId}');
resourcePathControl?.setValidators(this.resourcePathValidators);
} else {
resourcePathControl?.setValue(null);
resourcePathControl?.setValue('');
resourcePathControl?.setValidators(null);
}

Expand Down

0 comments on commit 550857c

Please sign in to comment.