java - REST API design and changing "contract"? -


i'm designing restful api. result in form of json object. don't need send fields pojo classes client, should define kind of "contract".

let's have property class, , define id, name , address it. later, might want change address geodata, without influencing clients.

is there elegant way (pattern) this?

create versioning rest design. when start create new implementation, use new uri define it. example create new uri similar parameter, difference in version:

  • old implementation /ver1/retrieve/user ( still being maintained )
  • new implementation /ver2/retrieve/user

by doing this, client still able retrieve user old implementation without issue. when decide change implementation again, it's better freeze old version of api ( example when implementing v3 api, should notify client old version 1 api no longer supported )

more information can found here :

how version rest uris

versioning restful services


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -