Skip to content

Dangling refs to booleanOperations_and/_or/_not in the generated document #46

Description

@kudima03

PureQLQueryDocumentTransformer never emits the booleanOperations/and, booleanOperations/or and booleanOperations/not schemas. All three are referenced from booleanReturning — the type of Query.where, Query.having and of every nested condition/conditions:

"booleanReturning": { "oneOf": [
  { "$ref": "#/components/schemas/scalars_booleanScalar" },
  { "$ref": "#/components/schemas/parameters_booleanParameter" },
  { "$ref": "#/components/schemas/booleanOperations_and" },
  { "$ref": "#/components/schemas/booleanOperations_or" },
  { "$ref": "#/components/schemas/booleanOperations_not" },
  { "$ref": "#/components/schemas/equality" },
  { "$ref": "#/components/schemas/comparison" }
]}

None of those three components exist in components.schemas — 3 of the 7 oneOf branches point at nothing.

What lands in the document instead is a booleanOperations component, which Microsoft.OpenApi parses as a schema: the child key not is taken for the JSON Schema keyword of the same name, while and and or end up in unrecognizedKeywords. The component's resulting keys are ['not', 'unrecognizedKeywords'], and it now means "the value must NOT match the shape of the not-operator" — the exact opposite of what was intended.

Reproduces against the current PureQL-Specification.json: 159 emitted schemas, exactly 3 dangling refs. booleanOperations is the only node where this shows up.

Effect: Scalar cannot resolve the three branches, so the where/having view breaks in the UI for the most commonly used operators; a client generated from this document either fails on the unresolved reference or silently drops and/or/not.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions