HI Jim,
I guess that you are doing an update of an User through a UserPatch, am
I right?
Your JSON is wrong; there is an error in your JSON definition:
Unrecognized field "schema"
"schema" and "values" should be into "attrTo", since they are attributes
of AttrTO entity.
Here is a correct example:
{
"plainAttrs": [
{
"attrTO": {
"schema":"firstname",
"schemaInfo": {
"anyTypeClass":"BaseUser",
"@class":"org.apache.syncope.common.lib.to.PlainSchemaTO",
"key":"firstname"
},
"values": [
"myname"
]
},
"operation":"ADD_REPLACE"
}
],
"key":"b58456e3-8cb7-4183-8456-e38cb73183a4"
}
Please use also swagger application at [1] to play with Syncope REST
services.
HTH,
Andrea
[1] http://syncope-vm.apache.org:9080/syncope/swagger/
Il 09/01/2018 11:40, Jim ha scritto:
Good day,
I would like to ask about the error i encountered when I tried to call
http://localhost:8080/syncope/rest/users/b58456e3-8cb7-4183-8456-e38cb73183a4
This is my sample JSON BODY:
{
"plainAttrs": [
{
"schema":"firstname",
"attrTO": {
"schemaInfo": {
"anyTypeClass":"BaseUser",
"@class":"org.apache.syncope.common.lib.to.PlainSchemaTO",
"key":"firstname"
}
},
"values": [
"myname"
],
"operation":"ADD_REPLACE"
}
],
"key":"b58456e3-8cb7-4183-8456-e38cb73183a4"
}
ERROR:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><syncope2:error
xmlns:syncope2="http://syncope.apache.org/2.0"><elements><element>UnrecognizedPropertyException:
Unrecognized field "schema" (class
org.apache.syncope.common.lib.patch.AttrPatch), not marked as ignorable (2
known properties: "attrTO", "operation"])
at [Source: (org.apache.cxf.transport.http.AbstractHTTPDestination$1);
line: 4, column: 14] (through reference chain:
org.apache.syncope.common.lib.patch.UserPatch["plainAttrs"]->java.util.HashSet[0]->org.apache.syncope.common.lib.patch.AttrPatch["schema"])</element></elements><status>500</status><type>Unknown</type></syncope2:error>
Hope you can help me!
Thank you!
Regards,
Jim
--
Sent from: http://syncope-user.1051894.n5.nabble.com/
--
Dott. Andrea Patricelli
Tel. +39 3204524292
Developer @ Tirasa S.r.l.
Viale D'Annunzio 267 - 65127 Pescara
Tel +39 0859116307 / FAX +39 0859111173
http://www.tirasa.net
Apache Syncope PMC Member