New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WFCORE-204 CLU GUI upload for op params with ModelType.BYTES #271
Conversation
ModelNode response = execute(opDesc, false); | ||
ModelNode requestProps = response.get("result", "request-properties"); | ||
for (Property prop : requestProps.asPropertyList()) { | ||
if (ModelType.valueOf(prop.getValue().get("type").asString()) == ModelType.BYTES) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will throw an IAE if the server-side author screwed up and there is no "type" declaration. That shouldn't happen with folks using "modern" subsystem authoring, but it's possible with some old stuff someone outside WildfFly may have.
You can do an isDefined check, or, since the ModelType of "type" is by spec supposed to be ModelType, you can do this:
ModelNode typeDesc = prop.getValue().get("type");
if (typeDesc.getType() == ModelType.TYPE && typeDesc.asType() == ModelType.BYTES) {
That will avoid failing on any bogus strings (e.g. "long") people may have stuck into a "type" description. Again, anything in WildFly/EAP itself shouldn't have such bogus stuff, so this is just being careful about external stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Brian. I made your suggested change. Works well.
@aloubyansky please approve. |
Looks good to me. |
WFCORE-204 CLU GUI upload for op params with ModelType.BYTES
No description provided.