Skip to content

Commit

Permalink
adding marketplaces schema validation
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewfl committed Mar 15, 2014
1 parent 02ad70b commit 7440f11
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 0 deletions.
5 changes: 5 additions & 0 deletions features/rest/marketplace.feature
@@ -0,0 +1,5 @@
Feature: Marketplace

Scenario: Get marketplace
When I GET to /marketplaces
Then the response is valid according to the "marketplaces" schema
100 changes: 100 additions & 0 deletions fixtures/marketplaces.json
@@ -0,0 +1,100 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"links": {
"type": "object",
"properties": {
"marketplaces.cards": {
"type": "string",
"format": "uri",
"pattern": "/cards"
},
"marketplaces.bank_accounts": {
"type": "string",
"format": "uri",
"pattern": "/bank_accounts"
},
"marketplaces.external_accounts": {
"type": "string",
"format": "uri",
"pattern": "/external_accounts"
},
"marketplaces.credits": {
"type": "string",
"format": "uri",
"pattern": "/credits"
},
"marketplaces.debits": {
"type": "string",
"format": "uri",
"pattern": "/debits"
},
"marketplaces.refunds": {
"type": "string",
"format": "uri",
"pattern": "/refunds"
},
"marketplaces.reversals": {
"type": "string",
"format": "uri",
"pattern": "/reversals"
},
"marketplaces.customers": {
"type": "string",
"format": "uri",
"pattern": "/customers"
},
"marketplaces.events": {
"type": "string",
"format": "uri",
"pattern": "/events"
},
"marketplaces.callbacks": {
"type": "string",
"format": "uri",
"pattern": "/callbacks"
},
"marketplaces.card_holds": {
"type": "string",
"format": "uri",
"pattern": "/card_holds"
},
"marketplaces.orders": {
"description": "Orders in which the customer is either a buyer or merchant",
"type": "string",
"format": "uri",
"pattern": "/orders",
"TODO": "THIS IS MISSING"
}
},
"required": [
"marketplaces.cards",
"marketplaces.bank_accounts",
"marketplaces.credits",
"marketplaces.debits",
"marketplaces.refunds",
"marketplaces.reversals",
"marketplaces.customers",
"marketplaces.events",
"marketplaces.callbacks",
"marketplaces.card_holds"
]
},
"meta": {
"type": "object"
},
"marketplaces": {
"items": {
"$ref": "_models/marketplace.json"
},
"type": "array",
"minItems": 1,
"maxItems": 1,
"uniqueItems": true
}
},
"required": [
"marketplaces"
]
}

0 comments on commit 7440f11

Please sign in to comment.