When serializing POJO/Java Bean, I have some ideas to mention:
Follow common convention with common JSON library like Gson,Jackson,Fastjson
static fields should not be serialized
fields without public getter should not serialized
such that actual response body will be as same as possible with expected body describe by JSONDoc
Customize domain-specific business:
only fields with public setters should be serialized for request body
fields without public getters should not be serialized for response body
such that actual request body would not pass read-only fields to server, actual response body would not pass write-only fields to client.
and JSONDoc will be more tight-integrated with back-end services in real application scenarios.
When serializing POJO/Java Bean, I have some ideas to mention:
such that actual response body will be as same as possible with expected body describe by JSONDoc
such that actual request body would not pass read-only fields to server, actual response body would not pass write-only fields to client. and JSONDoc will be more tight-integrated with back-end services in real application scenarios.