Skip to content

Conversation

@mhmd-azeez
Copy link
Contributor

@mhmd-azeez mhmd-azeez commented Nov 5, 2024

  • make sure all required properties are actually defined
  • make circular references illegal (this blows up JSON.stringify even in NodeJS)
  • the normalizer returns multiple errors now
  • fix: when a property is untyped (object with no properties), the xtpType.name is set to the property name.
    expect((properties[8].xtpType as ObjectType).name).toBe("")

    anUntypedObject:
    description: An untyped object with no properties
    type: object
  • check for invalid identifiers: exports/imports/schemas/properties/enums
  • add more tests

errors: ValidationError[];
}

function detectSchemaRefCycles(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something about this function feels too big. I wrote some code to workaround cycles by storing cycles then processing them later. so part of that was detecting cycles and storing them. and it was only a few lines of code. Perhaps i was missing something though. Either way i think this is good because it's separate from the main parse and normalize code so we can easily remove it later.

@mhmd-azeez mhmd-azeez merged commit c39a49b into main Nov 10, 2024
3 checks passed
@mhmd-azeez mhmd-azeez deleted the normalizer-errors branch November 10, 2024 20:06
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

Successfully merging this pull request may close these issues.

3 participants