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

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

Open
aschekatihin opened this issue Jul 12, 2016 · 0 comments
Open

Comments

@aschekatihin
Copy link

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\"}"
                }
            }
        }
    }
},
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant