Skip to content

Conversation

@siddharthbaleja7
Copy link

This PR addresses build failures caused by a TypeScript version mismatch and improves schema validation.

Issues Fixed

  1. Build Failure: The project was using TypeScript ^3.8.3, which is incompatible with newer type definitions in dependencies like @types/whatwg-url. This caused errors like TS1109: Expression expected during compilation.
  2. Schema Validation: Added "format": "iri-reference" to the TD.schema.json to ensure proper validation of IRI references.

Changes

  • Upgraded TypeScript: Bumped typescript dev dependency to ^4.9.5 in package.json.
  • Updated Lockfile: Refreshed package-lock.json to match new dependencies.
  • Enhanced Schema: minimal update to schemas/TD.schema.json to include "format": "iri-reference".

Verification

  1. Run npm install to update dependencies.
  2. Run npm run compile to verify the build succeeds.
  3. Check schemas/TD.schema.json to confirm the format addition.

@siddharthbaleja7
Copy link
Author

Hi @egekorkan and @relu91 ! I've submitted this PR to resolve the TypeScript build blockers I encountered. I also took the opportunity to align the anyUri definition in the TD schema with the W3C IRI standards.

This provides a stable foundation for the EdiTDor integration and ensures the validation logic is spec-compliant. I'm looking forward to your feedback!

Comment on lines -9 to +10
"type": "string"
"type": "string",
"format": "iri-reference"
Copy link
Member

Choose a reason for hiding this comment

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

The validation schema should be compliant with https://github.com/w3c/wot-resources/blob/main/td/v1.1/validation/td-json-schema-validation.json, which does not have the format keyword. I don't remember why it was removed, but I recall it was problematic for some reason. @egekorkan do you remember?

Copy link
Member

Choose a reason for hiding this comment

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

This was due to different implementations not validating it exactly correct. So we just say string now.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, we should then see how vscode interpret it. Do you have some test cases we can use?

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