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
{{ message }}
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
I'm trying to use a JSON API. The API defines a specific mime type => application/vnd.kippt.YYYYMMDD+json (where YYYYMMDD is the date of the API you want to use). This way they introduce a versioned API.
I'm not saying that it's a good solution to version API, but I just try to use their API !
Width @accept annotation, I can only use MediaType which is an Enum. With class Spring MediaType, I can create my own Mediatype.
I think that adding two attributes to @accept annotations would be enough (type and subtype).
Replace the MediaType enum with a class holding String constants, and update @Accept to take a String value() param
Keep the current value() parameter that can have a default empty value, and add a new stringType() (we need to find a better name) that accepts Strings.
I think the first option would be more universal. And it should be retrocompatible, if we keep the same qualified name for MediaType.
I think I did that because Spring dependencies are not available in androidannotations project. So, I have created our own MediaType to use the "native" annotation validation.
Activity
pyricau commentedon Jun 28, 2012
I think that's a quite valid use case. @a-thomas what do you think ?
pyricau commentedon Jun 28, 2012
For
@Accept, we can either :MediaTypeenum with a class holding String constants, and update@Acceptto take a Stringvalue()paramvalue()parameter that can have a default empty value, and add a newstringType()(we need to find a better name) that accepts Strings.I think the first option would be more universal. And it should be retrocompatible, if we keep the same qualified name for
MediaType.In the generated code, instead of:
We would do:
pyricau commentedon Jun 28, 2012
And by the way, @a-thomas , why did we create our own
MediaTypeenum instead of usingorg.springframework.http.MediaType?a-thomas commentedon Jul 3, 2012
I think I did that because Spring dependencies are not available in androidannotations project. So, I have created our own
MediaTypeto use the "native" annotation validation.See:
a-thomas commentedon Jul 3, 2012
I totally agree with you. I create an issue.
pyricau commentedon Jul 3, 2012
You're right :) .
Merge pull request #261 from excilys/260_Replace_@Accept_MediaType
pyricau commentedon Aug 2, 2012
Fixed by cd09c11