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 url tagged data type #1270

Open
jclark opened this issue Oct 25, 2023 · 2 comments
Open

Add url tagged data type #1270

jclark opened this issue Oct 25, 2023 · 2 comments
Labels
Area/Lang Relates to the Ballerina language specification Type/Improvement Enhancement to language design

Comments

@jclark
Copy link
Collaborator

jclark commented Oct 25, 2023

This would be a tagged data type (like regexp), so that it can be serialized as a string in JSON. Relates to #1098.

Probably url is the right tag. From https://url.spec.whatwg.org/#goals:

Standardize on the term URL. URI and IRI are just confusing. In practice a single algorithm is used for both so keeping them distinct is not helping anyone. URL also easily wins the search result popularity contest.

@jclark
Copy link
Collaborator Author

jclark commented Oct 25, 2023

Need to think about how interpolation (${...}) works. Currently it is defined to take values of the interpolated data type, but I think we also need it to takes strings. Interpolating a string would effectively quote it using the URL syntax (so it would works safely for query parameters).

@jclark
Copy link
Collaborator Author

jclark commented Oct 25, 2023

A bigger issue would be to tie this into resource functions somehow (but resource paths aren't URLs).

@anupama-pathirage anupama-pathirage added Type/Improvement Enhancement to language design Area/Lang Relates to the Ballerina language specification labels Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/Lang Relates to the Ballerina language specification Type/Improvement Enhancement to language design
Projects
None yet
Development

No branches or pull requests

2 participants