Comments (11)
Thanks - that fixed it, I was able to get a successful build! I'll do more thorough testing tomorrow.
from redocusaurus.
This build is working for me and resolves this issue.
from redocusaurus.
Might be related to Redocly/redoc#1724
Does your spec define a top level field swagger: "2.0"
?
from redocusaurus.
from redocusaurus.
Might be related to Redocly/redoc#1724
It is not - in that issue, the reporter had an invalid spec (version specified as an integer instead of a string).
I tested and verified that redoc-cli can properly load Swagger 2.0 files. However, it does report that it converts the file to 3.0 first:
[ReDoc Compatibility mode]: Converting OpenAPI 2.0 to OpenAPI 3.0
which I've tracked down to the loadAndBundleSpec utility function in redoc.
It seems like redocusaurus might be initiating redoc in a way that bypasses that conversion.
I see the same error when specifying a swagger 2.0 file in JSON format using the spec
option.
from redocusaurus.
@joshuaflanagan Thanks for tracking it down! It seems they are using this function in StoreBuilder : https://github.com/Redocly/redoc/blob/6c7685e5fa04314328a445d7077600692c49489c/src/components/StoreBuilder.ts
If we switch to using StoreBuilder too for creating the AppStore here:
Then this will solve both this and #80 I think.
from redocusaurus.
I have released a beta for v1 where this is fixed: #146
It has some breaking changes (mostly simplification of option names). New docs are at https://redocusaurus-v1.vercel.app/docs
It will be great if you could try it and give some feedback.
from redocusaurus.
I am trying to test it, but am running into errors. However, it is difficult to tell the source, since I am also attempting to update my version of docusaurus at the same time. If you tell me the exact version of docusaurus that you are testing on and expect to support, I can use the same. They have been releasing a lot of betas recently which can add to the confusion.
from redocusaurus.
To be clear, in my package.json I have:
"@docusaurus/core": "^2.0.0-beta.17",
"redocusaurus": "0.0.0-beta-20220314034003",
My attempt at running docusaurus build
results in:
[INFO] [en] Creating an optimized production build...
[ERROR] Unable to build website for locale en.
[ERROR] ValidationError: "layout" is not allowed
This appears to be referring to the spec definition in the redocusaurus config of docusaurus.config.js
.
My specs
config looks like:
[{
routePath: 'myservice/api',
spec: 'myservice/api.yaml',
layout: { title: 'Service API' }
}]
When I delete the layout
config line, I now get:
[INFO] [en] Creating an optimized production build...
[ERROR] Unable to build website for locale en.
[ERROR] ValidationError: "debug" is not allowed
I don't specify debug
anywhere. I also noticed that if I change routePath
to route
(which the docs suggest) I get [ERROR] ValidationError: "route" is not allowed
.
from redocusaurus.
Thanks for testing it out. Regarding beta, beta.17
is what is supported and what I'm using too.
And you are on the correct version of redocusaurus but my build was wrong. I just released a new version (from the latest commit) : 1.0.0-beta-20220315043813
.
Verified the dist files on unpkg and tested it on a fresh project. It should be working now
from redocusaurus.
Awesome! Thanks for testing it out.
There are some minor styling changes compared to v0 (see percy diff). I know the fix for most of those, so I'll release stable v1 once they are fixed.
from redocusaurus.
Related Issues (20)
- Extend deploy script to sign git commits. HOT 1
- [ERROR] TypeError: Cannot set properties of undefined (setting 'minItems') HOT 9
- CSS broken HOT 1
- Callbacks lack proper background in dark mode HOT 1
- Is there a way to run the APIs through the redoc component ? HOT 1
- Support for Docusaurus 3.0 HOT 9
- Example not hidden for schema imports
- Redocusaurus should collect heading ids / anchors HOT 2
- Webpack missing in Peer Dependencies HOT 1
- Error: Docusaurus server-side rendering could not render static page with path /api/ because of error: slugify: string argument expected HOT 2
- Issue with calling useColorMode outside the ColorModeProvider for Docusaurus 3.0.1 HOT 5
- Logo from spec (x-logo) not being rendered. HOT 3
- Add warning for deprecated options and remove them in next breaking version
- Generate code samples
- Support versioning API along with docs HOT 1
- API Reference page on mobile device HOT 2
- Footer UI defect
- Sidebar scrolls under navbar on direct visit HOT 2
- Standalone redoc plugin HOT 3
- Sidebar scroll not working properly with offset
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 redocusaurus.