Contents
How are resources defined in a RESTful API?
It is the responsibility of the API code to merge the application data together with the REST metadata and the other data into a single resource, resolving possible naming conflicts that may arise. We have defined resources, and defined the data associated with them in terms of the JSON data model.
Which is the primary data representation in rest?
REST Resource Naming Guide. In REST, primary data representation is called Resource. Having a strong and consistent REST resource naming strategy – will definitely prove your one of the best design decisions in long term. The key abstraction of information in REST is a resource.
Which is the key abstraction of information in rest?
The key abstraction of information in REST is a resource. Any information that can be named can be a resource: a document or image, a temporal service (e.g. “today’s weather in Los Angeles”), a collection of other resources, a non-virtual object (e.g., a person), and so on.
How is a document represented in the REST API?
In REST, you can view it as a single resource inside resource collection. A document’s state representation typically includes both fields with values and links to other related resources. Use “singular” name to denote document resource archetype.
How are sub-collections used in a RESTful API?
Sub-collections are usually used to express some kind of “contained in” relationship. We go into more detail on this in Relationships. The diagram below illustrates the key concepts in a RESTful API. We call information that describes available resources types, their behavior, and their relationships the resource model of an API.
Which is part of the resource model for an API?
The richness of data that can be associated with a resource is part of the resource model for an API. It defines for example the available data types and their behavior. Based on my experience, I have developed a strong conviction that the JSON data model has just the right “richness” so that it is an ideal data model for RESTful resources.