Quantcast
Channel: Question and Answer » json
Viewing all articles
Browse latest Browse all 148

Considerations about returning text instead of JSON in a JSON compliant API [closed]

$
0
0

I’m using Spring-Boot + Jackson to implement a Rest API. When I return some object from my methods the controllers are building a JSON compliant response. However, that’s not happening when I return primitive wrappers as String or Long (they don’t act as property-value maps, they’re just value wrappers in Java). Is it a non-desirable practice to return a non JSON compliant response from the API?

enter image description here

enter image description here


Viewing all articles
Browse latest Browse all 148

Trending Articles