Resource
A resource in a RESTful API is a data entity or object that can be accessed and manipulated using unique URLs and standard HTTP methods. It forms the foundation for data exchange between clients and the API. The specification user decides whether sub-resources should be referred to as a part of their main resource or as a resource of their own.
This acts as the root element of the ZSPEC.
Child Elements
- Components
- Info required
- Resource Config required
- Server required recurrent
- Url required recurrent
- Authentication
- Authentication Schema
- Dependency
The <authentication> at the <operation> level is given the higher priority as it helps in configuring different authentication for different operations. Whereas, the authentication at the resource level is generic to all the operations, despite different <url> and is given the lowest priority.
Attributes
Name | Type | Description |
---|---|---|
specification required |
String | The XSD version of the ZSPEC format. |
name required |
String | Name of the resource and it should be unique for a particular product. |
product required |
String | Name of the Catalyst project to which you need to upload your ZSPEC. |
pre-loaded required |
Boolean | Denotes whether the resource has data at initial state (when user creates a new account in your product).
|
file-version required |
String | It is an auto-populated id which is generated every time a user modifies the ZSPEC. It ensures that the user uploads the latest version of the file. |
Samples
Resource details
Let us say that we are trying to write the ZEST Specification file for the following requirements
copy- ZSPEC Version: 1.0.0 - Resource: trips - Product Name: travel_bureau - Pre Loaded: true
Here is how you declare the resource and its attributes.
copy<resource specification="1.0.0" name="trips" product="travel_bureau" pre-loaded="true" />
File Version
Consider two developers, Diana and Brian, collaborating on the same trips resource, which has already been uploaded to ZEST. The file version created during the upload is 04j3v9n7gdy2vht0p6n8zqx5s7r. Firstly, Diana updates her changes to this version and the file version changes to 01h5h6fm6dcsent0qftwyyd4nf. Now, Brian tries to update his changes to the initial file version and faces this error “The resource has been updated since you have started editing it.”.
This is because Brian is working on the initial file version of the ZSPEC which does not have the recent changes of Diana. So, Brian should update his changes only to the new file version (01h5h6fm6dcsent0qftwyyd4nf). He can either discard his changes or resolve the merge conflicts in the editor.
The resource element of the Brian’s updated ZSPEC file would look like this,
copy<resource file-version="01h5h6fm6dcsent0qftwyyd4nf" name="trips" product="travel_bureau" pre-loaded="true" specification="1.0.0" />
Last Updated 2025-05-30 16:54:59 +0530 +0530
Yes
No
Send your feedback to us