-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Allow resolving only relative and absolute refs and leave local refs unresolved #27
Comments
+1 :-) |
I've been thinking of doing this for a while. My plan is to add two new options:
Then you can resolve all locals only, all remotes only or all of them. |
We also need to allow only resolving relative remotte refs and leave absolute ones. This could be the case for a multi-file JSON Schema that uses absolute refs for default/base JSON Schemas from http://json-schema.org/ |
Works for me. I'm sure this seem simple...I look forward to how painful the implementation becomes. ;) |
+1 |
I thought about this some today working on #30. I've not forgotten. |
+1 this would be great as currently using allOf in swagger definitions and then processing through json-ref prduces an error. If you don't have time I could have a look at it |
If there is an error with |
Hi, |
I've not started yet but I can bump it up in priority. |
Ok no problem ! If you can it's nice otherwise I'm already doing a workaround (but I must use some copy/paste right now :-( to avoid using allOf) |
+1 |
+1 @whitlockjc any updates on that issue? need it very much |
+1 |
Sorry for the delay. I'll work on it over the weekend. If you've not heard from me, feel free to reply here to throw it in my inbox. |
+1 |
@whitlockjc just as you suggested, reminding you about the issue. :) thanks a ton for the great work btw! |
I'm working on it as we speak. |
+1 would be nice to have this feature |
+1 for this feature |
We're running into the same problem here. We want to resolve only relative local file paths to consolidate our different files into a single one, but keep all absolute URLs (https://...) and #/definitions/.. (Swagger) intact. |
@whitlockjc is there any progress done on this front? if you're under time pressure, maybe you could point in the right direction so someone else can pick it up instead? |
Here's a pull request a colleague of mine just released: #41 |
I'll take a peek. I apologize for the delay, I've been traveling. |
Included new options resolveRemoteRefs, resolveFilRefs and resolveLocalRefs
👍 |
Hi...Can you show me how to use the new option(s)? I'm using the code from: http://azimi.me/2015/07/16/split-swagger-into-smaller-files.html, and I don't like the fact it expanded the $ref inline for me for the definitions..Thanks! var resolve = require('json-refs').resolveRefs; var root = YAML.load(fs.readFileSync('index.yaml').toString()); |
The API documentation is located here: https://github.com/whitlockjc/json-refs/blob/master/docs/API.md#resolveRefs Depending on which reference type(s) you want to resolve, update the options you created appropriately. |
Per requests here and here users want to resolve a multi-file JSON file into one file without resolving local (fragment URIs) refs. If we can specify which of these types of refs to resolve it would be perfect:
The text was updated successfully, but these errors were encountered: