question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BUG: nullable schema

See original GitHub issue

Hi! I think this project is useful and so interesting.

I have a question. Why do generator use interface for schema definition?

I think type alias is more useful.

e.g.

https://swagger.io/specification/#:~:text=A true value adds "null" to the allowed type specified by the type keyword%2C only if type is explicitly defined within the same Schema Object.

schema:
  type: object
  nullable: true
  properties:
    foo:
      type: integer
type schema = { foo: number } | null;

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Himenoncommented, Nov 15, 2022

I published v0.19.2. Thanks your bug report !

And, I could align everything to type alias, but that would be a disruptive change to existing users and I need to provide options to minimize that. However, I do not have the time to provide that option, so I will only release a patch to allow nullable.

@ssssota

1reaction
Himenoncommented, Nov 15, 2022

It does not matter whether it is a Type Alias or an interface. I believe the essence of the issue is whether the problem is solved or not.

By the way, do you mean that there is a problem with specifying nullable in the case that @ssssota wrote about? Could you please provide some more details?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug when a schema has a nullable AllOf ref · Issue #20 - GitHub
Hey! I have a weird issue that happens with refs that are nullable. I have the following schema: "GroupWithRecentMessage": { "type": ...
Read more >
Using nullability in GraphQL
GraphQL improves on that by having a complete schema of your available data, and giving you back exactly the fields you asked for....
Read more >
Property X in class Y is nullable on one side and not on the other
This error likely means that the property in question has been made Required either in the client code or in the Sync cloud...
Read more >
Nulls in GraphQL: Cheatsheet - Hasura
Nullability in GraphQL is a controversial topic. Some say constant null checks are a nuisance, while others err on the side of paranoia....
Read more >
Solved: The schema validation failed : Bug?
This error does NOT occur every time my flow rund.. it is sporatic. In my understanding a String can be null and still...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found