Comments (4)
@sn4kebite sorry for the late reply, I've been busy lately. :(
I'm not quite sure I understand your use case correctly. Could you please elaborate? For what purpose exactly you want to use relative HTTP URL? I mean, if you specify a path on filesystem, the spec would be copied to output directory and relative URL would be used automatically.
from redoc.
Alternatively, in some cases (when only domain is changed), you may use something like:
'spec': 'http:///api/rest/spec.yaml',
which will try to download the spec from /api/rest/spec.yaml
from the same domain.
Please respond whether it worked for you or not.
from redoc.
I am building a docker image containing both API and documentation. The spec.yaml file is not available when the documentation is being built, as it is generated by the API on demand.
From what I understand this is when you want to use an HTTP URL to the spec, however I don't know the URL in advance. The spec can however be found relative to the docs, so using a relative URL in this case solves this problem.
Using the HTTP URL without hostname is a neat trick (I didn't know you could do that), but I'm concerned how well supported it is (no results on google that I could find), and it only works with either http or https.
from redoc.
Using the HTTP URL without hostname is a neat trick (I didn't know you could do that), but I'm concerned how well supported it is (no results on google that I could find),
Well, honestly, I don't know; this is behaviour I observe in Python when you do urljoin
.
and it only works with either http or https.
A doubt Redoc.js support any other protocol except for HTTP(s). It's a limitation of JS machines in browsers.
Still I do understand your use case now. I'm thinking about fallbacking to HTTP relative URI if the corresponding file wasn't found. I.e.
-
You would still have something like
'spec': '/api/rest/spec.yaml',
-
The extension will try to find a file of filesystem first.
-
If found, it will be copied over to output directory.
-
If not found, the extension would pass
/api/rest/spec.yaml
"As Is" to Redoc.js.
from redoc.
Related Issues (20)
- openapi: 3.0.1 support HOT 3
- Fails to build some targets HOT 1
- Move to sphinx-contrib organization? HOT 6
- Download YAML file too HOT 3
- TypeError('sequence item 0: expected str instance, int found',) when we do make html HOT 1
- server url is not correct HOT 4
- The generated doc don't show any exemple of request and response HOT 2
- Ordering of endpoints is random with the use of yaml library : switch to oyaml HOT 1
- Minor Issue in docs HOT 2
- No "type" specified at "/paths/~1test/post/parameters/0". Automatically detected: "object" HOT 2
- Error in docs
- Referenced `yml` files are not copied HOT 2
- No Support for OpenAPI 3.0 HOT 3
- Internationalization
- Sphinx-contrib extension error: urlopen error [Errno -3]
- Redoc page rendering only when used in toctree directive.
- Remove usage of pkg_resources
- Aborted attempted copy warning about `redoc.js`
- Default template file?
- Can't add CSS?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redoc.