Skip to content

incorrect jsonschema generated when additionalProperties is present #2

Description

@lloyd

On Mon, Feb 22, 2010 at 02:58:24PM +0200, Petri Lehtinen wrote:

It seems to me that the "try it" editor on orderly-json.org works
incorrectly regarding the additionalProperties attribute. It outputs

"additionalProperties": true / false

Here's a quote from the JSON schema specification, regarding the
additionalProperties attribute:

The value must be a schema. If false is provided, no additional
properties are allowed, and the schema can not be extended. The
default value is an empty schema which allows any value for
additional properties.

The spec doesn't tell what exactly is an empty schema, but "the schema
for JSON schemas" (http://json-schema.org/schema) has {} as the
default value for "additionalProperties", so I believe that the
correct output should be

 "additionalProperties": {} / false

The "additionalProperties" could also be left out at all when the
object definition is open (i.e. there's an asterisk at the end).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions