mson

MSON to describe object attributes in blueprint

女生的网名这么多〃 提交于 2019-12-23 02:31:20
问题 I have an issue similar to what is described here. I have a JSON that looks like this: { "photos": [ { "key": "y37dmj10jkwof/moOIUB8912JKVgh", "caption": "A world of gamers.", "tags": [ "game", "japan" ], "attributes": { "copyright": true, "use": [ "public", "private" ] } } ] } and I am trying to describe the attributes using MSON, to render the blueprint. However, I am not successful at it. Here is my attempt: + Attributes (required, object) + photos (required, array) + (object) + key

How to extend rather than replace parent Parameters?

十年热恋 提交于 2019-12-11 07:34:53
问题 I've got a resource with multiple parameters, and a single action with one extra. How can I write this with the minimal repeats? Something like this, but that actually works: ## Items [/item{?type}] + Parameters + type (enum[string], optional) + Default: foo + Members + foo + bar ### List [GET {&from}] + Parameters + page (integer, optional) + Default: 1 All other actions should list type , while the GET should list both type and page . 来源: https://stackoverflow.com/questions/41960087/how-to

Repeating a MSON data structure with different values

☆樱花仙子☆ 提交于 2019-12-10 11:44:06
问题 I have many places in my API where I will need to describe a list of objects. Each object has the same keys / structure but different values. How can I tweak the values of each instance of some data structure while retaining all the original type, description, etc of the original structure? for example if I had the following data structure Restaurant # Data Structures ## Restaurant (object) + restaurant_name: McDonald's (string, required) - The name of this restaurant + years_of_operation: 54

Trying to describe the request and response using Data Structures in API Blueprint

半世苍凉 提交于 2019-11-30 06:56:15
I'm trying to document an endpoint with API Blueprint, using the new Attributes and DataStructures sections of the spec. My request payload looks like this: { "url": "http://requestb.in/11v7i7e1", "active": true, "types": [ { "name": "sales", "version": "2.0" }, { "name": "products", "version": "2.0" } ] } My response payload looks something like that: { "data": { "id": "dc85058a-a683-11e4-ef46-e9431a15be8c", "url": "http://requestb.in/11v7i7e1", "active": true, "types": [ { "name": "products", "version": "2.0" }, { "name": "sales", "version": "2.0" } ] } } I tried the following API Blueprint

Trying to describe the request and response using Data Structures in API Blueprint

人盡茶涼 提交于 2019-11-29 08:04:45
问题 I'm trying to document an endpoint with API Blueprint, using the new Attributes and DataStructures sections of the spec. My request payload looks like this: { "url": "http://requestb.in/11v7i7e1", "active": true, "types": [ { "name": "sales", "version": "2.0" }, { "name": "products", "version": "2.0" } ] } My response payload looks something like that: { "data": { "id": "dc85058a-a683-11e4-ef46-e9431a15be8c", "url": "http://requestb.in/11v7i7e1", "active": true, "types": [ { "name": "products