Skip to content

serban-petrescu/sapim-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sapim sample

Sample project using the sapim library

This is a simple JSON form validator API proxy definition built with the SAP API Manager Tools.

Prerequisites

You should have node-js and npm installed.

Instructions

To deploy the proxy on your own API Manager account:

Test cases

With valid input:

curl -X POST \
  https://your-api-management.host.com/sample \
  -H 'Content-Type: application/json' \
  -d '{
	"name": "Spet",
	"email": "something@example.com",
	"address": {
		"city": "Cluj",
		"street": "Brassai"
	}
}'
{
    "result": "ok"
}

With invalid input:

curl -X POST \
  https://your-api-management.host.com/sample \
  -H 'Content-Type: application/json' \
  -d '{
	"name": "Spet",
	"email": "not-an-email",
	"address": {
		"city": "Cluj"
	}
}'
[
    {
        "message": "Email must be valid.",
        "path": "email"
    },
    {
        "message": "Street is required.",
        "path": "address.street"
    }
]

Releases

No releases published

Packages

No packages published