Skip to content

Additional properties #6

Description

@Knetic

Object schemas, currently, only support well-defined properties. JSON-Schema defines a key "additionalProperties" as a boolean, expressing whether or not the data may include unorganized extras along with the normal data.

This should be supported. Dynamic languages (ruby, python, js) should just attach further data onto their instances without question. Typed languages (Go, Java, C#) should include a generic "getAttribute" and "setAttribute" method (with appropriately vague interface{}, or Object types for return/set), and have a protected/unexported member associative array which can be modified underneath.

This isn't a good design pattern, but it may have uses (such as when forwarding unknown data in a payload).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions