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 and required not forwarded from $ref #227

Closed
kevich opened this issue Apr 15, 2019 · 1 comment
Closed

additionalProperties and required not forwarded from $ref #227

kevich opened this issue Apr 15, 2019 · 1 comment

Comments

@kevich
Copy link

kevich commented Apr 15, 2019

Due to normalise of additionalProperties and required before making dereference(), seems the properties additionalProperties and required from $res do not properly passed into main schema.

Here's an example:
main_schema.json:

{
  "title": "MainSchema",
  "type": "object",
  "$ref": "reference.json"
}

reference.json:

{
  "title": "Reference",
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": ["name"]
}

expected d.ts for main_schema.json would be:

export interface MainSchema {
  name: string;
}

but it will be:

export interface MainSchema {
  name?: string;
  [k: string]: any;
}

which is wrong...

@kevich kevich changed the title additionalProperties and required not forwarded from $ref additionalProperties and required not forwarded from $ref Apr 15, 2019
@bcherny
Copy link
Owner

bcherny commented Nov 29, 2020

Unable to repro -- this is fixed.

@bcherny bcherny closed this as completed Nov 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants