You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider two services, a GET and a POST. In order to support both JSON/XML and x-www-form-urlencoded, two POST definitions are currently needed (in recent version of Jersey). E.g.,
/** * Accepts answers to questions that map to Standard Data Set attributes. * * @author Derek Moore <a href="mailto:dmoore@fanthreesixty.com">dmoore@fanthreesixty.com</a> */publicinterfaceAnswersResource {
@GET@Consumes({
MediaType.APPLICATION_JSON,
MediaType.APPLICATION_XML,
})
@Produces({
MediaType.APPLICATION_JSON,
MediaType.APPLICATION_XML,
})
publicList<QuestionAnswer> get(@QueryParam("flowId") UUIDflowId);
/** * Post an answer to a Standard Data Set question. * @param answer an answer to a Standard Data Set question * @return the answer as saved */@POST@Consumes({
MediaType.APPLICATION_JSON,
MediaType.APPLICATION_XML,
})
@Produces({
MediaType.APPLICATION_JSON,
MediaType.APPLICATION_XML,
})
publicQuestionAnswerpost(QuestionAnsweranswer);
/** * Form post an answer to a Standard Data Set question. * @param flowId the flow the question is in * @param orgId the id for the org that the question belongs to * @param customerId the customer answering the question * @param attributeKey the attribute the question answers * @param value the chosen value of the attribute * @param values the chosen values of the attribute * @return the answer as saved */@POST@Consumes({
MediaType.APPLICATION_FORM_URLENCODED,
})
@Produces({
MediaType.APPLICATION_JSON,
MediaType.APPLICATION_XML,
MediaType.TEXT_HTML,
})
publicQuestionAnswerpost(@NotNull@FormParam("flowId") UUIDflowId,
@NotNull@FormParam("orgId") UUIDorgId,
@NotNull@FormParam("customerId") UUIDcustomerId,
@NotNull@FormParam("attributeKey") StringattributeKey,
@FormParam("value") Stringvalue,
@FormParam("values") List<String> values);
}
Additional information is available in this old Jersey PR to unify Jersey's date parsing in support of unified JAXB xml/json & BeanParam form objects: https://github.com/jersey/jersey/pull/94
The text was updated successfully, but these errors were encountered:
We discussed this on the September 12 meeting - here are the minutes for this item:
New issue: 117 - this might be a complicated scenario - might need some sort of “multi-purpose” annotation to indicate that the parameter could be a @BeanParam or an entity…
May not make sense if not currently supported on server side yet
I think this is a good idea, but may need to wait until a later release.
Allow objects to work with JAXB/JSON-B &
@BeanParam
.Allowing dual-use POJOs helps unify JAX-RS resource definitions.
Consider two services, a
GET
and aPOST
. In order to support both JSON/XML and x-www-form-urlencoded, twoPOST
definitions are currently needed (in recent version of Jersey). E.g.,Additional information is available in this old Jersey PR to unify Jersey's date parsing in support of unified JAXB xml/json & BeanParam form objects: https://github.com/jersey/jersey/pull/94
The text was updated successfully, but these errors were encountered: