Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FieldMap provides wrong JsonSchema in RAML #8

Closed
leonadler opened this issue May 10, 2017 · 0 comments
Closed

FieldMap provides wrong JsonSchema in RAML #8

leonadler opened this issue May 10, 2017 · 0 comments

Comments

@leonadler
Copy link

leonadler commented May 10, 2017

FieldMap is a "hash with any value type" model - { [k: string]: any } in TypeScript.
The RAML wrongly returns a type that has a single boolean empty property.

"fields": {
    "type": "object",
    "id": "urn:jsonschema:com:gentics:mesh:core:rest:node:FieldMap",
    "required": true,
    "description": "Dynamic map with fields of the node language specific content.",
    "properties": {
        "empty": {
            "type": "boolean"
        }
    }
}

This produces an incorrect TypeScript model:

export interface FieldMap {
    empty: boolean;
}

GenericResponse is correctly typed in the RAML, FieldMap needs to have a similar JsonSchema:

"fields": {
    "type": "object",
    "id": "urn:jsonschema:com:gentics:mesh:core:rest:node:FieldMap",
    "required": true,
    "description": "Dynamic map with fields of the node language specific content.",
    "additionalProperties": {
        "type": "any"
    }
}

This would produce the correct TypeScript model:

export interface FieldMap {
    [key: string]: any;
}
@leonadler leonadler closed this as not planned Won't fix, can't repro, duplicate, stale Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant