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

Invalid type is generated in case of union type including object type #31

Open
sakai-akinobu opened this issue Nov 14, 2018 · 0 comments

Comments

@sakai-akinobu
Copy link
Contributor

Converting the following definitions

{
  "id": "Foo",
  "type": ["object", "null"],
  "properties": {
    "bar":  {
      "type": "string"
    }
  }
}

The following values ​​are returned.

export type Foo = {
  bar?: string
} | {
  bar?: string
};

I think that the type definitions below should be returned correctly.

export type Foo = {
  bar?: string
} | null;

I wrote the reproduction code.

https://github.com/sakai-akinobu/investigation-of-json-schema-to-flow-type-with-union-type

environment

  • json-schema-to-flow-type@1.0.0
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