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

Compilation error with similar definition names #465

Open
michaelmior opened this issue Oct 31, 2024 · 1 comment
Open

Compilation error with similar definition names #465

michaelmior opened this issue Oct 31, 2024 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@michaelmior
Copy link

The generated code for the schema below fails to compile. I'm not quite sure what's going on, but interestingly when the maxLength restriction is removed, the error disappears.

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "id": { "$ref": "#/definitions/id_def" },
    "id2": { "$ref": "#/definitions/iddef" }
  },
  "definitions": {
    "id_def": {
      "type": "string",
      "maxLength": 70
    },
    "iddef": {
      "type": "string",
      "maxLength": 70
    }
  }
}
@mwadams
Copy link
Contributor

mwadams commented Oct 31, 2024

When the maxlength is removed they both resolve to a built in string type.

When both are generated we are supposed to disambiguate collisions when we PascalCase the type names (removing underscores, changing the casing) but for some reason this is not happening in this case.

We have specs for this so I just need to figure out the corner case!

@mwadams mwadams added the bug Something isn't working label Oct 31, 2024
@mwadams mwadams added this to the V4.0 milestone Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants