Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for tag URIs #9

Closed
Julian opened this issue Apr 12, 2023 · 4 comments
Closed

Add tests for tag URIs #9

Julian opened this issue Apr 12, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@Julian
Copy link
Member

Julian commented Apr 12, 2023

We have tests for HTTP(s) and URN schemed URIs.

It probably couldn't hurt to have some for the tag scheme.

At least one example is here.

@Julian Julian added the enhancement New feature or request label Apr 12, 2023
@joooeey
Copy link

joooeey commented Apr 18, 2023

I think the focus on the tag scheme is a bit odd. Of the over 300 URI schemes registered with IANA, tag is not the third-most important. But it's a great example for a semi-exotic URI/scheme, especially because we have the linked test case (low hanging fruit).
What about file, ftp, etc.? Does it make sense to add tests for those too?

@Julian
Copy link
Member Author

Julian commented Apr 18, 2023

Those schemes are basically similar in syntax to other ones (well, HTTP), and they're also "old", so it's unlikely an implementation that works for one will fail on another. Tag is both newer and also "different" even from URN because of the commas, so it seemed more likely that some language will not necessarily have good tag URI support in its standard library.

Meanwhile I don't expect any to have issue with any of the above "in reality", but I'm ok with adding tests for any or all if you're interested!

@joooeey
Copy link

joooeey commented Apr 18, 2023

I think tag is a good one to throw into the tests because it's perfectly valid in the spec and new. Virtually nobody uses it, (especially not in jsonschema), so it might trip up many implementers which is exactly what's intended.

I do think file scheme should absolutely be in there because there are applications that act like there's only the web and others that act like there's only the file system.

I just looked through the examples and noticed that very common and meaningful elements of many URI schemes (e.g. https) such as ? and # are not in there.

@Julian
Copy link
Member Author

Julian commented Apr 18, 2023

I do think file scheme should absolutely be in there because there are applications that act like there's only the web and others that act like there's only the file system.

PR definitely welcome! #8 is essentially the existing issue for file://.

very common and meaningful elements of many URI schemes (e.g. https) such as ? and # are not in there.

Empty fragments are definitely there, see e.g. absolute-uri-empty-fragment.json -- Non-empty fragments aren't valid in IDs (IIRC in any version but I forget). I think query strings aren't either, but I also forget. If you do check and find them valid, PR certainly welcome there too (or else an issue).

@Julian Julian closed this as completed in 36b0eb3 Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants