fix(jans-cli): sample returned by using --schema
option is malformed for JansAttribute
schema #8713
Closed
Description
As mentioned in #8711, the --schema
option (currently) returns a sample of the actual JSON object that the user can use directly to perform operation.
For JansAttribute
schema, the sample returned is malformed. It throws an error due to invalid structure of attributeValidation
key.
root@jans-node:~# /opt/jans/jans-cli/config-cli.py --schema JansAttribute > /tmp/attribute.json
root@jans-node:~# nano /tmp/attribute.json // Just updated the sample for name key
root@jans-node:~# /opt/jans/jans-cli/config-cli.py --operation-id post-attributes --data /tmp/attribute.json
Server Response:
{
"server_error": "com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `java.lang.Integer` from Object value (token `JsonToken.START_OBJECT`)\n at [Source: (org.eclipse.jetty.server.HttpInput); line: 1, column: 564] (through reference chain: io.jans.model.JansAttribute["attributeValidation"]->io.jans.model.attribute.AttributeValidation["minLength"])"
}
root@jans-node:~#
Expectation
Sample should work out of the box.