Currently the protocol server uses core yaml (core_0.9.4.yaml and core_1.1.0.yaml) for request validation. The script to use depends on the version string in the context. Extend this facility to use a combination of version and domain tag.
Requirements:
A new optional configuration value needs to be added called useDomainSpecificYAML. The default value should be false. If this configuration value is not there in default.yaml, even then it should be considered as false.
If the value of useDomainSpecificYAML is false, the system will use the current logic of choosing the yaml file based on the version in the context
If the value of useDomainSpecificYAML is true, the system will create a filename of form $context_$version.yaml and try to load that for validation. If that file does not exist, then it uses the current logic of using only the version.
Test cases:
Do not have the key useDomainSpecificYAML in default.yaml. The protocol server should pick up core_0.9.4.yaml or core_1.1.0.yaml for validation.
Have the key useDomainSpecificYAML in default.yaml and give it a value false. The protocol server should pick up core_0.9.4.yaml or core_1.1.0.yaml for validation.
Have the key useDomainSpecificYAML in default.yaml and give it a value true. Do not add any domain specific file. The protocol server should pick up core_0.9.4.yaml or core_1.1.0.yaml for validation.
Have the key useDomainSpecificYAML in default.yaml and give it a value true. Have a domain specific file. Now send a request in the same domain and version. The new file should be picked up for validation.
Description
Currently the protocol server uses core yaml (core_0.9.4.yaml and core_1.1.0.yaml) for request validation. The script to use depends on the version string in the context. Extend this facility to use a combination of version and domain tag. Requirements:
useDomainSpecificYAML
. The default value should be false. If this configuration value is not there in default.yaml, even then it should be considered as false.$context_$version.yaml
and try to load that for validation. If that file does not exist, then it uses the current logic of using only the version.Test cases:
useDomainSpecificYAML
in default.yaml. The protocol server should pick up core_0.9.4.yaml or core_1.1.0.yaml for validation.useDomainSpecificYAML
in default.yaml and give it a value false. The protocol server should pick up core_0.9.4.yaml or core_1.1.0.yaml for validation.useDomainSpecificYAML
in default.yaml and give it a value true. Do not add any domain specific file. The protocol server should pick up core_0.9.4.yaml or core_1.1.0.yaml for validation.useDomainSpecificYAML
in default.yaml and give it a value true. Have a domain specific file. Now send a request in the same domain and version. The new file should be picked up for validation.