Skip to content
This repository was archived by the owner on Feb 12, 2022. It is now read-only.
This repository was archived by the owner on Feb 12, 2022. It is now read-only.

Schema references in resource methods aren't code generation friendly #183

@aschekatihin

Description

@aschekatihin

At the moment parser generates raml model object three with body or response sections that look like this:

"responses": {
    "200": {
        "body": {
            "application/json": {
                "schema": "{\"$schema\": \"http://json-schema.org/draft-04/schema\"}"
                }
            }
        }
    }
},

Schema name is lost at this point and replaced with schema content (JSON). We are creating custom code generator and need original schema name there, so it would be nice to have structure like this:

"responses": {
    "200": {
        "body": {
            "application/json": {
                "schemaName": "User",
                "schema": "{\"$schema\": \"http://json-schema.org/draft-04/schema\"}"
                }
            }
        }
    }
},

Or like this, but it will be breaking change for everyone relying to current structure:

"responses": {
    "200": {
        "body": {
            "application/json": {
                "schema": {
                    "name": "User",
                    "content": "{\"$schema\": \"http://json-schema.org/draft-04/schema\"}"
                }
            }
        }
    }
},

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions