Skip to content

Latest commit

 

History

History
72 lines (66 loc) · 1.44 KB

File metadata and controls

72 lines (66 loc) · 1.44 KB

Elysia swagger malformed response schema

Posts schema:

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "title": {
                "type": "string"
            }
        },
        "required": ["title"]
    }
}

Generated Posts response schema:

{
    "responses": {
        "200": {
            "items": {
                "type": "object",
                "properties": {
                    "title": {
                        "type": "string"
                    }
                },
                "required": ["title"]
            },
            "content": {
                "application/json": {
                    "schema": {
                        "type": "array"
                    }
                }
            }
        }
    }
}

The expected schema is:

{
    "responses": {
        "200": {
            "content": {
                "application/json": {
                    "schema": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "title": {
                                    "type": "string"
                                }
                            },
                            "required": ["title"]
                        }
                    }
                }
            }
        }
    }
}