Level3-REST / OpenAPI

OpenAPI specs for profiles
Apache License 2.0
0 stars 0 forks source link

Link header definition #1

Open mattbishop opened 4 years ago

mattbishop commented 4 years ago

@handrews contributed a JSON-schema version that cannot be expressed in OAS 3; perhaps 3.1 will?

{ "type": "array", "minItems": 2, "uniqueItems": true, "items": [ { "type": "string", "pattern": "^<.*>$", } ], "additionalItems": { "type": "object", "minProperties": 1, "maxProperties": 1, "properties": { "rel": {...}, "title": {...}, "anchor": {...}, ... } }, "contains": { "type": "object", "required": ["rel"] } }

handrews commented 4 years ago

@mattbishop yes, OAS 3.1 will support full compatibility with JSON Schema draft 2019-09, assuming nothing happens to derail https://github.com/OAI/OpenAPI-Specification/pull/1977

We worked through the wording of the thorniest problem this week, so I think it's a pretty safe bet at this point.

However, I feel compelled to format that schema with indentation 😃

{
    "type": "array",
    "minItems": 2,
    "uniqueItems": true,
    "items": [
        {   
            "type": "string",
            "pattern": "^<.*>$",
        }   
    ],  
    "additionalItems": {
        "type": "object",
        "minProperties": 1,
        "maxProperties": 1,
        "properties": {
            "rel": {...},
            "title": {...},
            "anchor": {...},
            ... 
        }   
    },  
    "contains": {
        "type": "object",
        "required": ["rel"]
    }   
}
mattbishop commented 4 years ago

That's just a copy-paste from Slack! I need to fill in the rel/title/anchor bits as well.