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 | null dropping alias annotations

See original GitHub issue
/**
 * @minimum 1
 * @TJS-type integer
 */
type natural = number;

interface Schema {
    id: natural | null;
}

This results in json for a plain unannotated number being generated. With @nullable, it does work correctly.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:8
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
marneborncommented, Jun 8, 2021
/**
 * @minimum 1
 * @TJS-type integer
 */
type natural = number;

interface Schema {
  n1: natural | null;
  n2: natural;
}

Becomes:

    "Schema": {
      "type": "object",
      "properties": {
        "n1": {
          "type": [
            "null",
            "number"
          ]
        },
        "n2": {
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "n1",
        "n2"
      ]
    },

While I would expect:

    "Schema": {
      "type": "object",
      "properties": {
        "n1": {
          "type": {
            "anyOf": [
              {
                type: "null" 
              },
              {
                "minimum": 1,
                "type": "integer"
              }
          ]
        },
        "n2": {
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "n1",
        "n2"
      ]
    },
1reaction
lvyangxucommented, Dec 17, 2020

same for me,–strictNullChecks not work

Read more comments on GitHub >

github_iconTop Results From Across the Web

Null annotations are extremely hard to use in an existing project
I was trying to use null annotations in o.e.jdt.ui but it becomes extremely hard very quickly. Actually I should say it is impossible...
Read more >
Spring data JPA: getting No aliases found in result tuple! error ...
Searching for this error shows spring data jpa: No aliases found in result tuple! Make sure your query defines aliases which says that...
Read more >
Path-Sensitive and Alias-Aware Typestate Analysis for ...
However, each OS inevitably has bugs, as it is quite large and complex. Even a simple OS bug. (such as null-pointer dereference) can...
Read more >
Full Text Bug Listing - Red Hat Bugzilla
Summary: Coverity-detected defect: null pointer dereferences in uri.c ... don't check g_strdup arg for NULL 2458810 Drop superfluous conditionals around ...
Read more >
Opaque Type Aliases - Scala 3 - EPFL
object MyMath: opaque type Logarithm = Double object Logarithm: // These are the two ways to lift to the Logarithm type def apply(d:...
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