Skip to content
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

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

Closed
ossdhaval opened this issue Jun 14, 2024 · 0 comments · Fixed by #8746
Assignees
Labels
area-documentation Documentation needs to change as part of issue or PR comp-jans-cli-tui Component affected by issue or PR good first issue Good for newcomers help wanted Extra attention is needed kind-bug Issue or PR is a bug in existing functionality

Comments

@ossdhaval
Copy link
Contributor

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.

@ossdhaval ossdhaval added kind-bug Issue or PR is a bug in existing functionality good first issue Good for newcomers help wanted Extra attention is needed area-documentation Documentation needs to change as part of issue or PR comp-jans-cli-tui Component affected by issue or PR labels Jun 14, 2024
@ossdhaval ossdhaval changed the title fix(jans-cli): samples returned by using --schema option are malformed for JansAttribute fix(jans-cli): sample returned by using --schema option is malformed for JansAttribute schema Jun 14, 2024
devrimyatar added a commit that referenced this issue Jun 19, 2024
Signed-off-by: Mustafa Baser <mbaser@mail.com>
yuriyz pushed a commit that referenced this issue Jun 20, 2024
* fix(jans-cli): sample schema generetation (ref: #8713)

Signed-off-by: Mustafa Baser <mbaser@mail.com>

* feat(jans-cli): get schema for a given operation (ref: #8712)

Signed-off-by: Mustafa Baser <mbaser@mail.com>

---------

Signed-off-by: Mustafa Baser <mbaser@mail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-documentation Documentation needs to change as part of issue or PR comp-jans-cli-tui Component affected by issue or PR good first issue Good for newcomers help wanted Extra attention is needed kind-bug Issue or PR is a bug in existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants