fabiomaffioletti / jsondoc

Easily generate docs and playground for your RESTful API
http://jsondoc.org
MIT License
264 stars 127 forks source link

Proposals on POJO/Java Bean serializing #230

Open fuweichin opened 7 years ago

fuweichin commented 7 years ago

When serializing POJO/Java Bean, I have some ideas to mention:

  1. 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

  1. 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.