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

Feature Request: Support required array, vs required on each property #323

Closed
tylerprete opened this issue Mar 20, 2015 · 0 comments
Closed

Comments

@tylerprete
Copy link

In json_schema v4, the idiomatic way to do required properties is with a required array at the end of the object:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "$ref": "#/definitions/abc",
  "id": "resource:///json_schema/match/abc.json#",
  "definitions": {
    "abc": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "age": {
          "type": "string"
        }
      },
      "required": ["name", "age"]
    }
  }
}

jsonschema2pojo supports required on each property, but ignores the required array at the end.

We have a lot of files using this, so we don't really want to refactor them all. I'd be happy to try my hand at it, especially if you could point me in the right direction.

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