-
Notifications
You must be signed in to change notification settings - Fork 33
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
Fix issue #107 where /path and path were being considered the same #113
base: master
Are you sure you want to change the base?
Conversation
Current coverage is
|
Not sure why code coverage comment above says |
An alternate solution, inspired by RFC 3986 3. Syntax Components and 3.3. Path, could be:
In Uri, |
Thanks @evanbennett. I like it. We could maybe do the same to the trait Uri[P <: Path] {
def path: P
// Generic methods that use Path
} case class AbsoluteUri(scheme: String, host: String, path: AbsolutePath) extends Uri[AbsolutePath]
// ProtocolRelativeUrl does not have a scheme
case class ProtocolRelativeUri(host: String, path: AbsolutePath) extends Uri[AbsolutePath]
case class DocumentRelativeUri(path: RootlessPath) extends Uri[RootlessPath]
case class SiteRelativeUri(path: AbsolutePath) extends Uri[AbsolutePath] At first I thought that |
Being such a big change, this would be a major version bump. I haven't been using semantic versioning properly, so maybe this would be a good chance to start with version |
I have been researching and thinking about this since I posted. One of the things that I wanted to do was to have multiple Uris as you have suggested. (I was not sure that you would have been interested in such a big change.) One of the other things that I noted was that when parsing, you have:
but you do not use them in the Uri. If we were going to subclass the Uri, would you be open to moving these class to the Would you like me to put something together in my fork? |
I'd absolutely be interested. Even though it would be a big change, I think it would be a good move. I'm happy for |
I have pushed to my repository the updates I have been working on.
No DSL changes (aside from compatibility changes), this will be completed as a separate task. I started updating the README, but as I am unsure what will get accepted, I stopped. I have not submitted a pull request, as I am not sure you will like all the changes. You may just want pieces of the changes, I am not sure. I just went ahead and implemented what I am happy with. If you were to want to move in this direction, I was thinking we could release v1.0.0 which has only a few backwards incompatibilities and a lot of deprecated methods to ease migration. Once, v1.0.0 is released, we could remove all the deprecations, and that would then be released as v1.1.0 straight away. Here is a list of the changes (that I am aware of) that are required to migrate an existing project to use v1.0.0:
Incompatibilities:
There quite a few I am going to work on updating the DSL while I await your feedback. |
Thanks for the work. Amazing contribution! I'll make a Once we get to a place we are really happy I'll branch the current master into a Because it is such a big change it might take a little while for me to review, but I'll get on it ASAP. |
I have completed my first attempt at the new DSL that is consistent with the new types and follows the conversation in #117. While implementing the tests, I felt the need to default parsing to RFC3986 compliant and enable delimiter parsing through I have not updated the README yet (same reason as before), and some documentation probably needs to be updated/added, but otherwise, I think this is complete and ready for review. Have you made any progress on your previous comment? (I am not trying to harass you. I am not very experienced with git and GitHub, and thought I might have missed something.) |
I was wondering if you had a chance to look into this? |
This PR looks like it resolves #107. Is there any status update on this? |
Hi @Petesta, sorry for the lack of updates on this. I am no longer part of the Net-A-Porter organisation and unfortunately there is unlikely to be any updates to this repo in the short term. I would like to fork a new version of scala-uri at some point based on @evanbennett's PR, but can't make any promises on when. |
Possible fix for #107.
This change uses a leading empty path part for situations where we want a leading slash in the path. I'm not overly convinced this is the best way to fix this. Open to other suggestions.