Skip to content

fix(jans-cli): sample returned by using --schema option is malformed for JansAttribute schema #8713

Closed
@ossdhaval

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.

Metadata

Assignees

Labels

area-documentationDocumentation needs to change as part of issue or PRcomp-jans-cli-tuiComponent affected by issue or PRgood first issueGood for newcomershelp wantedExtra attention is neededkind-bugIssue or PR is a bug in existing functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions