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

AdditionalProperties are not honored in v0.9.0 #32

Closed
anandsunderraman opened this issue Aug 23, 2021 · 3 comments
Closed

AdditionalProperties are not honored in v0.9.0 #32

anandsunderraman opened this issue Aug 23, 2021 · 3 comments

Comments

@anandsunderraman
Copy link

I am trying to generate a model from the following schema file.

It works fine with v0.8.0 but fails on v0.9.0

test.json

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "$ref": "#/definitions/TestObject",
  "definitions":
  {
    "TestObject":
    {
      "required":
      [
        "owner",
        "name"
      ],
      "properties":
      {
        "owner":
        {
          "type": "string"
        },
        "name":
        {
          "type": "string"
        },
        "config":
        {
          "patternProperties":
          {
            ".*":
            {
              "additionalProperties": true
            }
          },
          "type": "object"
        }
      },
      "additionalProperties": false,
      "type": "object"
    }
  }
}

Error:

gojsonschema -v -p model ../test.json -o test.go
gojsonschema: Loading ../test.json
gojsonschema: Failed: error parsing from file ../test.json: json: cannot unmarshal bool into Go struct field Type.definitions.properties.patternProperties.additionalProperties of type schemas.Type

@jdimeo
Copy link

jdimeo commented Sep 24, 2021

Is this fixed by #29?
Waiting for a release! :-)

@atreya2011
Copy link

atreya2011 commented Nov 16, 2021

@jdimeo you can use it right by doing this:
go install github.com/atombender/go-jsonschema/cmd/gojsonschema@master

@omissis
Copy link
Owner

omissis commented May 1, 2023

Added the test to the suite of regressions test here #76, closing.

@omissis omissis closed this as completed May 1, 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

4 participants