-
-
Notifications
You must be signed in to change notification settings - Fork 243
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
Any ref issue #200
Any ref issue #200
Conversation
Rather than expose a hash of schemas to the world (which you have to use a special function to get the key for), would the api be easier to use if there was a "get_schema" method (or similar), that expected a uri? Internally we could still use a hash and map the uris. This way the implementation details (ie the hash and the format used for it's keys) could be hidden from the rest of the codebase (and future changes would only appear in one place) |
Ok ignore that - that function already exists (schema_for). It's a shame we're passing normalised URIs around so much internally |
@RST-J can you point out where in the code we're using normalised URIs instead of uuids now? (I can't see it) |
@iainbeeston What I wanted to say is, that for schemas without ID which get a fake UUID, the key changes from |
For the issue of throwing around normalized URIs, I guess there is some potential to prevent normalizations if we figure out the spots where they are not really necessary and we just do them for needless precaution. I'll have another look at this in the evening (9 am around here ;) ). |
Actually it would be pretty useful to have some performance benchmarks (maybe as an own suite?) to figure out which way to do things is the fastest. Didn't @pd mention this recently? |
👍 btw |
Any more opinions? When this was merged we could release the next version :) |
👍, release away! |
Is the gem pushed to rubygems automatically when we release a version here on github or what are the steps to be taken? |
Or let me know and I'll gladly do it |
Oh, and we also need to bump the version. This discussion should probably be on #202 |
This fixes the issues mentioned in #190.
What does it do:
required
)normalized_uri
to be a util function that can be used anywhere (actually this would not be necessary anymore - should I revert this?)A consequence of the changes is that the Fake UUIDs also get converted to paths but I think that is Ok. If we ever attempt to load such a fake UUID file URI this has to be a bug I assume. And, I think it is better if we have a uniform way to create and lookup keys. Technically
http://foo.bar/some_schema#
andhttp://foo.bar/some_schema
have to be considered equal, but schema authors can use one or the other.As a developer I prefer to be clear about how the keys look like and do not want to reason about whether there is a # or not or whether there should be one or not.