Skip to content

Commit

Permalink
Update model for configuration source type parameters
Browse files Browse the repository at this point in the history
This commit changes the name of the configuration parameter property of
the configuration source type model so that it matches the model returned
by the trace server and as declared in the TSP specifications.

Signed-off-by: Hoang Thuan Pham <[email protected]>
  • Loading branch information
hoangphamEclipse committed Oct 17, 2023
1 parent a5128df commit e23c508
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"id": "my-source-type-1-id",
"name": "My configuration source 1",
"description": "My configuration source 1 description",
"configParamDescriptors": [
"parameterDescriptors": [
{
"keyName": "path",
"description": "path description",
Expand Down
4 changes: 2 additions & 2 deletions tsp-typescript-client/src/models/configuration-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ export interface ConfigurationSourceType {
* A list of query parameter keys to be passed when creating
* configuration instance of this type
*/
configParamDescriptors: ConfigParamDescriptor[];
parameterDescriptors: ConfigurationParameterDescriptor[];
}

/**
* Model of a configuration parameter descriptor
*/
export interface ConfigParamDescriptor {
export interface ConfigurationParameterDescriptor {
/**
* The unique name of the key
*/
Expand Down
23 changes: 12 additions & 11 deletions tsp-typescript-client/src/protocol/tsp-client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,17 +394,18 @@ describe('HttpTspClient Deserialization', () => {
expect(sourceTypes[0].name).toEqual('My configuration source 1');
expect(sourceTypes[0].description).toEqual('My configuration source 1 description');
expect(sourceTypes[0].id).toEqual('my-source-type-1-id');
expect(sourceTypes[0].configParamDescriptors).toHaveLength(2);

expect(sourceTypes[0].configParamDescriptors[0].keyName).toEqual('path');
expect(sourceTypes[0].configParamDescriptors[0].description).toEqual('path description');
expect(sourceTypes[0].configParamDescriptors[0].dataType).toEqual('STRING');
expect(sourceTypes[0].configParamDescriptors[0].isRequired).toBeTruthy();

expect(sourceTypes[0].configParamDescriptors[1].keyName).toEqual('test1');
expect(sourceTypes[0].configParamDescriptors[1].description).toBeUndefined();
expect(sourceTypes[0].configParamDescriptors[1].dataType).toBeUndefined();
expect(sourceTypes[0].configParamDescriptors[1].isRequired).toBeUndefined();
console.log(sourceTypes[0]);
expect(sourceTypes[0].parameterDescriptors).toHaveLength(2);

expect(sourceTypes[0].parameterDescriptors[0].keyName).toEqual('path');
expect(sourceTypes[0].parameterDescriptors[0].description).toEqual('path description');
expect(sourceTypes[0].parameterDescriptors[0].dataType).toEqual('STRING');
expect(sourceTypes[0].parameterDescriptors[0].isRequired).toBeTruthy();

expect(sourceTypes[0].parameterDescriptors[1].keyName).toEqual('test1');
expect(sourceTypes[0].parameterDescriptors[1].description).toBeUndefined();
expect(sourceTypes[0].parameterDescriptors[1].dataType).toBeUndefined();
expect(sourceTypes[0].parameterDescriptors[1].isRequired).toBeUndefined();
});

it('configurations', async () => {
Expand Down

0 comments on commit e23c508

Please sign in to comment.