The readJSON step does not return any key named 'class'
For example:
input = '{"class":"example","other":"value"}' echo "${input}" output = readJSON text: input echo "${output}"
Returns:
[Pipeline] Start of Pipeline [Pipeline] echo {"class":"example","other":"value"} [Pipeline] readJSON [Pipeline] echo [other:value] [Pipeline] End of Pipeline
Is this a reserved keyword?
Apparently this is because Jenkins uses a patched json-lib to remove "class", "declaringClass", and "metaClass" from json files. See https://github.com/jenkinsci/json-lib/blob/16052d1f74908fb59430eddd73f42aec2469b313/src/main/java/net/sf/json/JsonConfig.java#L49.