Skip to content

Commit e23c508

Browse files
Update model for configuration source type parameters
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]>
1 parent a5128df commit e23c508

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

tsp-typescript-client/fixtures/tsp-client/fetch-configuration-sources-0.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"id": "my-source-type-1-id",
44
"name": "My configuration source 1",
55
"description": "My configuration source 1 description",
6-
"configParamDescriptors": [
6+
"parameterDescriptors": [
77
{
88
"keyName": "path",
99
"description": "path description",

tsp-typescript-client/src/models/configuration-source.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ export interface ConfigurationSourceType {
2222
* A list of query parameter keys to be passed when creating
2323
* configuration instance of this type
2424
*/
25-
configParamDescriptors: ConfigParamDescriptor[];
25+
parameterDescriptors: ConfigurationParameterDescriptor[];
2626
}
2727

2828
/**
2929
* Model of a configuration parameter descriptor
3030
*/
31-
export interface ConfigParamDescriptor {
31+
export interface ConfigurationParameterDescriptor {
3232
/**
3333
* The unique name of the key
3434
*/

tsp-typescript-client/src/protocol/tsp-client.test.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -394,17 +394,18 @@ describe('HttpTspClient Deserialization', () => {
394394
expect(sourceTypes[0].name).toEqual('My configuration source 1');
395395
expect(sourceTypes[0].description).toEqual('My configuration source 1 description');
396396
expect(sourceTypes[0].id).toEqual('my-source-type-1-id');
397-
expect(sourceTypes[0].configParamDescriptors).toHaveLength(2);
398-
399-
expect(sourceTypes[0].configParamDescriptors[0].keyName).toEqual('path');
400-
expect(sourceTypes[0].configParamDescriptors[0].description).toEqual('path description');
401-
expect(sourceTypes[0].configParamDescriptors[0].dataType).toEqual('STRING');
402-
expect(sourceTypes[0].configParamDescriptors[0].isRequired).toBeTruthy();
403-
404-
expect(sourceTypes[0].configParamDescriptors[1].keyName).toEqual('test1');
405-
expect(sourceTypes[0].configParamDescriptors[1].description).toBeUndefined();
406-
expect(sourceTypes[0].configParamDescriptors[1].dataType).toBeUndefined();
407-
expect(sourceTypes[0].configParamDescriptors[1].isRequired).toBeUndefined();
397+
console.log(sourceTypes[0]);
398+
expect(sourceTypes[0].parameterDescriptors).toHaveLength(2);
399+
400+
expect(sourceTypes[0].parameterDescriptors[0].keyName).toEqual('path');
401+
expect(sourceTypes[0].parameterDescriptors[0].description).toEqual('path description');
402+
expect(sourceTypes[0].parameterDescriptors[0].dataType).toEqual('STRING');
403+
expect(sourceTypes[0].parameterDescriptors[0].isRequired).toBeTruthy();
404+
405+
expect(sourceTypes[0].parameterDescriptors[1].keyName).toEqual('test1');
406+
expect(sourceTypes[0].parameterDescriptors[1].description).toBeUndefined();
407+
expect(sourceTypes[0].parameterDescriptors[1].dataType).toBeUndefined();
408+
expect(sourceTypes[0].parameterDescriptors[1].isRequired).toBeUndefined();
408409
});
409410

410411
it('configurations', async () => {

0 commit comments

Comments
 (0)