示例#1
0
def test_convert_dublin_core(dummy_guillotina):
    all_schemas = convert_interfaces_to_schema([IDublinCore])
    schema = all_schemas[IDublinCore.__identifier__]["properties"]
    assert "title" in schema
    assert "creation_date" in schema
    assert "tags" in schema
    assert schema["tags"]["type"] == "array"
示例#2
0
def test_convert_dublin_core(dummy_guillotina):
    all_schemas = convert_interfaces_to_schema([IDublinCore])
    schema = all_schemas[IDublinCore.__identifier__]['properties']
    assert 'title' in schema
    assert 'creation_date' in schema
    assert 'tags' in schema
    assert schema['tags']['type'] == 'array'
示例#3
0
def test_convert_dublin_core(dummy_guillotina):
    all_schemas = convert_interfaces_to_schema([IDublinCore])
    schema = all_schemas[IDublinCore.__identifier__]['properties']
    assert 'title' in schema
    assert 'creation_date' in schema
    assert 'tags' in schema
    assert schema['tags']['type'] == 'array'
示例#4
0
def patch_content_json_schema_parameters(content):
    return [{
        "name": "body",
        "in": "body",
        "schema": {
            "allOf": [
                {"$ref": "#/definitions/WritableResource"},
                {"properties": convert_interfaces_to_schema(
                    get_all_behavior_interfaces(content))}
            ]
        }
    }]
示例#5
0
def get_content_json_schema_responses(content):
    return {
        "200": {
            "description": "Resource data",
            "schema": {
                "allOf": [
                    {"$ref": "#/definitions/ResourceFolder"},
                    {"properties": convert_interfaces_to_schema(
                        get_all_behavior_interfaces(content))}
                ]
            }
        }
    }
示例#6
0
def patch_content_json_schema_parameters(content):
    return {
        "required": True,
        "content": {
            "application/json": {
                "schema": {
                    "type": "object",
                    "allOf": [
                        {"$ref": "#/components/schemas/WritableResource"},
                        {"properties": convert_interfaces_to_schema(get_all_behavior_interfaces(content))},
                    ],
                }
            }
        },
    }
示例#7
0
def get_content_json_schema_responses(content):
    return {
        "200": {
            "description": "Resource data",
            "content": {
                "application/json": {
                    "schema": {
                        "allOf": [
                            {"$ref": "#/components/schemas/ResourceFolder"},
                            {
                                "type": "object",
                                "properties": convert_interfaces_to_schema(
                                    get_all_behavior_interfaces(content)
                                ),
                            },
                        ]
                    }
                }
            },
        }
    }