Skip to content

Commit

Permalink
Update 0011-tsp-analysis-api.md for support of json-schema
Browse files Browse the repository at this point in the history
Use a json-schema (https://json-schema.org/) in ConfigurationSourceType
to describe the expected parameters to be passed when creating a
configuration instance.

Signed-off-by: Bernd Hufmann <[email protected]>
  • Loading branch information
bhufmann committed Aug 30, 2024
1 parent 486edd8 commit 1514d6a
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions doc/adr/0011-tsp-analysis-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ Date: 2024-08-29

## Status

Proposed - v2
Proposed - v3

Version v1
Initial version
Version v2
Remove "Configuration service per experiment"
Add "Configure customizable outputs"
Version v3
Support of json-schema for configuration source types

## Context

Expand Down Expand Up @@ -49,7 +51,8 @@ ConfigurationSourceType {
description: string,
id: string,
scope: string,
parameterDescriptors: ConfigurationParameterDescriptor[]
parameterDescriptors?: ConfigurationParameterDescriptor[],
schema?: string
}
```

Expand All @@ -59,11 +62,14 @@ Where:
- `description`: The description of the configuration source type. Can be shown to the end-user.
- `id`: Unique id of the configuration source type. Used in the application to distinquish configuration source types
- `scope:` `experiment` for configuration source types per experiment or `global` for all experiments
- `parameterDescriptors`: A list of descriptors that describe the parameters that the front-end needs to provide with corresponding values. For example, use "path" for file path.
- `parameterDescriptors`: A list of descriptors that describe the parameters that the front-end needs to provide with corresponding values. For example, use "path" for file path. Use this instead of `schema`.
- `schema`: a JSON schema that describes the parameters that the front-end needs to provide with corresponding values. Use this for complex parameter descriptions instead of `parameterDescriptors`.

Note: One of `parameterDescriptors` and `schema` must be present.

#### Configuration parameter descriptor

The configuration parameter descriptor describes a parameter that the front-end needs to provide with corresponding values. This descriptor will help implementing a UI for the parameters.
The configuration parameter descriptor describes a parameter that the front-end needs to provide with corresponding values. This descriptor will help implementing a UI for the parameters. Use this for simple parameters. For complex parameter descriptions use a [json-schema](#configuration-parameter-schema) instead.

```javascript
ConfigurationParameterDescriptor {
Expand All @@ -81,6 +87,10 @@ Where:
- `dataType`: A data type hint to the client. Helps implementing validation of values in the front-end.
- `isRequired`: A flag indicating whether parameter is required or not.

#### Configuration parameter schema

The configuration parameter schema describes parameters that the front-end needs to provide with corresponding values. This descriptor will help implementing a UI for the parameters. Use this for complex parameter descriptions use a [json-schema](#configuration-parameter-schema) and omit the list of [configuration parameter descriptors](#configuration-parameter-descriptor). The schema string has to comply with the [json-schema specification](https://json-schema.org/)

#### Configuration descriptor

The configuration descriptor describes an instance of an external configuration for a given source type. This descriptor is used to distinquish the different external configurations for a given type.
Expand Down

0 comments on commit 1514d6a

Please sign in to comment.