简体   繁体   中英

How to construct REST dto's?

I am in the process of building a REST api which accepts a set of arguments, processes it and gives a boolean response.

My question is how do I build a dto object. I can create a Java POJO in one of the applications and use it as REST parameter but that creates a dependency on this application. Is there a better way to pass an object as REST parameter?

note: the reason I am not using path params because my dto object might contain a list of objects as well and I am not sure how to pass that using path param.

You can create a library which contains the DTO class if dependency is your concern.

After all the DTO is dependent on the REST API. If one changes the other must change too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM