Contacts Application is a sample CRUD application. The application allows you to browse through a list of contacts, as well as add, update, and delete contacts.
In this cookbook, we will demonstrate, how you can validate this sample test application using vREST.
The application has the following REST API endpoints:
Method | API Endpoint | Action |
---|---|---|
GET | /contacts | Retrieve all contacts |
GET | /contacts/{{id}} | Retrieve the contact with the specified id |
POST | /contacts | Add a new contact |
PUT | /contacts/{{id}} | Update the contact with the specified id |
DELETE | /contacts/{{id}} | Delete the contact with the specified id |
The application has two versions.
Version 1.0.0: In this version, the contact model has the following schema with some validations.
{ name: {type: String, required: true, maxLength: 35}, email: {type: String}, designation: {type: String, maxLength: 35}, organization: {type: String, maxLength: 35}, country: {type: String, maxLength: 35}, aboutMe: {type: String}, linkedInId: {type: String}, githubId: {type: String}, facebookId: {type: String}, twitterId: {type: String} } |
The version 1.0.0 of the Contacts Application can be accessed at the following URL:
Version 2.0.0: In this version, we added the following functional additions in the contact model of the application:
{ name: {type: String, required: true, maxLength: 35}, email: {type: String, validator: emailValidator}, designation: {type: String, maxLength: 35}, organization: {type: String, maxLength: 35}, country: {type: String, maxLength: 35}, aboutMe: {type: String, maxLength: 500}, linkedInId: {type: String}, githubId: {type: String}, facebookId: {type: String}, twitterId: {type: String} } |
The version 2.0.0 of the Contacts Application can be accessed at the following URL:
http://example.vrest.io/contacts/v2/test