You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The value field of ConfigProperty instances returned from methods such as ConfigurationControllerApi#readConfiguration(String) and ConfigurationControllerApi#getConfiguration() is always null.
I have attached a full Groovy script which demonstrates this issue.
Proposed Solution
Looking at the generated code, it appears this issue is being caused by an erroneous enum in the ConfigProperty model of spec.json. The relevant JSON snippet being:
"ConfigProperty": {
"properties": {
"value": {
"type": "string",
"description": "Configuration property value.",
"enum": [
"Depends on property type. It can be number",
"string",
"URL",
"email or value from values list."
]
}
}
}
The value field has an enum constraint which appears to contain a description rather than allowable values. Because of this, the value field of the ConfigProperty class is being generated as an enum rather than a String. Since value is an enum, the API client is parsing the value returned by SSC as null since it does not match any items in the enum.
Removing the enum constraint from the spec.json file should fix this; however, I'm assuming the spec file in this repo was generated by SSC so only fixing it here would mean this would continue to be a problem for anyone generating their own client from SSC. A fix probably needs to be made to SSC as well.
The text was updated successfully, but these errors were encountered:
Thanks a lot for your thorough investigation Charles. Will pass this over to the SSC team. We're planning to generate a new version of the client for every new spec.json that corresponds to the SSC release. The spec that's used in this repository is fairly old, a lot of bugs has been fixed since. We're planning to review the REST API in 21.2 due to SOAP deprecation, it's currently scheduled for Nov 2021.
Problem
The
value
field ofConfigProperty
instances returned from methods such asConfigurationControllerApi#readConfiguration(String)
andConfigurationControllerApi#getConfiguration()
is always null.For example, executing this Groovy script:
will output:
I have attached a full Groovy script which demonstrates this issue.
Proposed Solution
Looking at the generated code, it appears this issue is being caused by an erroneous enum in the ConfigProperty model of spec.json. The relevant JSON snippet being:
The
value
field has an enum constraint which appears to contain a description rather than allowable values. Because of this, the value field of the ConfigProperty class is being generated as an enum rather than a String. Sincevalue
is an enum, the API client is parsing the value returned by SSC as null since it does not match any items in the enum.Removing the enum constraint from the spec.json file should fix this; however, I'm assuming the spec file in this repo was generated by SSC so only fixing it here would mean this would continue to be a problem for anyone generating their own client from SSC. A fix probably needs to be made to SSC as well.
The text was updated successfully, but these errors were encountered: