Page tree
Skip to end of metadata
Go to start of metadata

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.

Useful links:

  1. Download the source code from Github.
  2. REST API specifications: Swagger File (TODO)
  3. Setup / install contacts application.

REST Endpoints:

The application has the following REST API endpoints:

MethodAPI EndpointAction
GET/contactsRetrieve all contacts
GET/contacts/{{id}}Retrieve the contact with the specified id
POST/contactsAdd a new contact
PUT/contacts/{{id}}Update the contact with the specified id
DELETE/contacts/{{id}}Delete the contact with the specified id

Versions:

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:

    http://example.vrest.io/contacts/v1/test
     

  • Version 2.0.0: In this version, we added the following functional additions in the contact model of the application:

    • added a email validator for email field
    • aboutMe field can now be maximum 500 characters long only
    {
        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

  • No labels