-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
2.0.0-alpha.x issues #384
Comments
Awesome job :) My swagger definition does not work yet: https://cloud.squidex.io/api/swagger/v1/swagger.json |
@SebastianStehle your spec is failing during converting it to OpenAPI 3 using swagger2openapi because you have combination of |
@RomanGotsiy are you passing |
Ok, I fixed it and there are no more warnings in the swagger editor: Now I get another error. |
@MikeRalphson thanks for the suggestion! I will enable those options in the next alpha! @SebastianStehle yes, I can see this issue too. It is also indirectly caused by conversion process. I am now discussing the best ways to fix it with @MikeRalphson. It will be definitelly resolved in the next alpha. type: string
format: binary You can check workarounded spec here |
But with the updated spec I get the other error. But I am pretty sure that you will solve it :) |
You need to patch out the |
Oh, sorry. Thats awesome. Even some of my problems with the stable version are fixed :) |
I've just published |
Works perfectly for my original definition :) |
@RomanGotsiy I talked with you about this issue a few weeks ago on Twitter and I put another example at https://github.com/mikunn/openapi-test-allof/blob/master/allof.yaml. So the issue is that properties in nested allOfs get lost. Running that specs shows only the We reuse lots of stuffs in our specs, so that's why we have allOfs all over the place. We can probably use a separate merger before feeding the spec to ReDoc, but would be nice to get a support directly from ReDoc :) Respect the effort as always! The docs seem crazy responsive 👍 |
Great work. Thanks! Does the new react ReDoc works with multiple specs?
|
Fantastic! Thanks for the fast fix, @RomanGotsiy, works perfectly! I still have another issue where ReDoc doesn't start at all displaying error "Cannot read property '$ref' of undefined". I created a new repo again at https://github.com/mikunn/openapi-test-refs. The issue appears when there are complex Maybe there are too many references to the same file (probably root This issue is in alpha-1 as well, so recent changes didn't break it. |
@mikunn I'm not sure In my resolver (which is not the one used by ReDoc) it creates this issue:
This is because I'm trying to preserve internal The JSON-Reference spec seems woolly on this point, and helpfully, does not feature any examples. Do you have a particular reading of the spec? |
With everything resolved (it seems when you start resolving, it is dangerous to stop), I see this issue:
from: /me:
get:
tags:
- Me
summary: Summary of Me
responses:
'200':
description: OK
content:
application/json:
schema:
allOf:
- allOf:
- type: object
properties:
href:
type: string
- customer:
type: object
properties:
id:
type: integer
href:
type: string This patch 'resolves' (ho-ho) it: diff --git a/me/schemas.yaml b/me/schemas.yaml
index 9a9a9ad..7efb479 100644
--- a/me/schemas.yaml
+++ b/me/schemas.yaml
@@ -7,5 +7,5 @@ components:
MeOut:
allOf:
- $ref: '../schemas.yaml#/components/schemas/SelfHref'
- - $ref: '#/components/schemas/Me'
+ - $ref: '#/components/schemas/Me/customer' |
@mikunn If you want to resolve/validate your OpenAPI 3.0 definitions as above, you can use swagger2openapi:
or
The online version at https://openapi-converter.herokuapp.com has also been updated to the latest version. |
@mikunn your case causes dereferencing issue in the ref parser I use. I've been able to simplify it a bit more but anyway it's really weird. I'll try to investigate it when I have spare time but can't promise it will be fixed quickly. |
@RomanGotsiy you could always have a ReDoc option which uses |
Thanks guys for the responses! I've used json-refs to dereference which works well with that spec, but it still leaves some refs behind. json-schema-ref-parser or swagger2openapi should do the trick. Thanks for the example, @MikeRalphson 👍. No rush with the fix, I can do the extra dereferencing step until this is fixed :) The other issue that are already fixed were way more important! I will try our other specs later and see how things work! |
I got dereferencing working with json-schema-ref-parser. I tried swagger2openapi, but it left some I have another issue though. ReDoc seems to ignore
If I move As a side note, if you forget the dash in This is starting to look really good. I'm running out of issues to report! 😃 |
@mikunn may not be related, but:
|
If you have a testcase, please could you raise an issue over on swagger2openapi ? Thanks. |
@MikeRalphson Ah, I "optimized" a bit too much. It doesn't seem to be related.
The spec is very complicated, but I'll see if I can reduce it to something sensible in a reasonable amount of time :) |
Does it support Request/Response external examples yet? I tried the standard Petstore example with an absolute url and a relative url to the json example files -
But clicking on links does nothing... |
@MikeRalphson @RomanGotsiy - Hey guys, I am using create-react-app and the build is failing because of lib/jptr.js in reftools is using split ES6 function and create-react-app throws error when third-party packages don't compile their code to ES5 before publishing to npm. let parts = prop.split('#') Error: Failed to minify the code from this file: Any workaround or shall I open a ticket on reftools project? |
Hi @j26nz thanks for reporting! What makes you think It's almost certainly the use of There should be no requirement for npm modules to limit themselves to ES5 or suffer the lengthier build cycles or bloated packages. In my view it should be the responsibility of the consumer to specify the baseline requirements of their build (as only they know that) and transpile as necessary. That said, reftools does seem to trip up webpack/babel/browserify and we're not 100% sure why that is. So, if you were to open an issue on reftools, it would probably get closed as a 'wontfix', but if that package needs a |
@j26nz @MikeRalphson this is uglify.js issue which doesn't support es6 code yet ( Anyway, I am transpiling @j26nz could you create an example repo with this issue? Thanks |
@suds123 it doesn't support |
I'm not sure this issue is strictly a 2.0.0 issue, but here goes... I inherited an API with a rough input structure. Essentially, I have a transactions endpoint that allows 3 formats of payment method input (ID, Token, Account) and 6 types of transactions (Auth, Capture, Sale, Refund, Credit, Void). Individually and with other endpoints, the discriminators for payment method and transactions behave as expected. Here's the smallest chunk of my OAS yaml that can get the point across:
You can see in the PaymentsOrder schema that I'm using DISCLAIMER: I know that this API is not ideal for OAS 3.0.0. The fact that the payment method fields are "flat" inside of the PaymentsOrder object is the root cause. Also, if this question is too broad for the 2.0.0 issues thread, I can delete and move it to its own issue. QUESTIONS:
UPDATE -- I resolved my issue by mapping the combinations into separate PaymentsOrder schemas. It has worked well. This ticket can be deleted if it is deemed to be not constructive. |
I'm back with an actual DESCRIPTION: I have a discriminator selector box that exhibits the following behavior:
This schema is used in multiple places in my documentation, and it behaves the same for all instances, at least one of which is nested inside of another rendered discriminator. Here are the relevant schemas:
Here is the
When the Account schema is rendered, 'visa' is selected as the first option, but the BankAccount fields are shown. When I select 'discover', the credit card fields are shown but 'savings' winds up selected. When I click 'discover' again, the credit card fields remain, and 'discover' is selected. The images below show (1) before selecting 'discover' the first time and (2) the result of first click of 'discover'. Is there something wrong with my schemas, or is this a rendering issue in |
I have two cosmetic issues, one related to the rendition of oneOf and the second to the rendition of examples. When you have a schema which makes use of oneOf (without any discriminator), the rendition looks like this: When you click on one of those
When you have mutiple examples, they do not get formatted according to the content type. In the below image you can see that it's |
Seems "response samples" section does not respect openapi 3.0 writeOnly attribute. Attribute "only_write" is not shown in "reponses" section but is shown in samples when using this minimalistic example: openapi: 3.0.0
info:
version: 1.0.0
title: test
paths:
/test:
get:
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/test_object'
responses:
200:
description: ok
content:
application/json:
schema:
$ref: '#/components/schemas/test_object'
components:
schemas:
test_object:
type: object
properties:
only_write:
type: string
writeOnly: true
read_write:
type: string readOnly is working as expected also in samples section. |
BUG: components:
schemas:
test_object:
oneOf:
- $ref: '#/components/schemas/Cat'
- $ref: '#/components/schemas/Dog'
Cat:
type: object
properties:
read_write:
type: string
only_read:
type: string
readOnly: true
only_write:
type: string
writeOnly: true
Dog:
type: object
properties:
name:
type: string |
Also regarding previous comment, when I click on Dog then I would expect that Dog button will become blue with white text and Cat white with blue text but this is not happening. |
Seems openapi 3.0.0 links https://swagger.io/docs/specification/links/ are not implemented, they are not shown nowhere. |
BUG: components:
schemas:
test_object:
allOf:
- type: object
properties:
prop:
type: object
properties:
nested_1:
type: string
- type: object
properties:
prop:
type: object
properties:
nested_2:
type: string |
This is really subtle but selecting menu items during scrolling could be triggered sooner. On first image I scrolled close to second item but still is selected first menu item in left top. On second image I scrolled little down so top horizontal line is above top edge and now is selected second item. Maybe would be better looking when are menu items selected as soon as that horizontal line goes through screen center in some point as is shown on third picture. Of course when clicking on menu items it is good as it is now that summary of selected item is scrolled to top. |
BUG: test_object:
type: object
properties:
array:
type: array
items:
type: object
properties:
only_read:
type: string
readOnly: true
only_write:
type: string
writeOnly: true
read_write:
type: string |
This looks like a new one for alpha12, but maybe I don't understand the OAS 3.0.0 docs.
Here is a brief example of how the 'Header' element is being populated in my spec:
And here is how I reference it in a path's operation's requestBody:
|
Are there plans to render the request examples based on discriminator selection? You can see in my example just above this that the only field that shows up for 'Account' is 'Type' (my discriminator) and none of the other fields (spec not shown but those fields include: Number, ExpirationDate, and Cvv2). |
Running redoc@2.0.0-alpha.12 but didn't manage to get scrollYOffset to work. Is this correct? |
Hey everyone, I release a new alpha with most the issues fixed since the previous alpha. I can't answer to everyone so please check the latest alpha and if your issue is not fixed, let me know. https://twitter.com/RomanHotsiy/status/974381615135719426 @misos1 links are not yet implemented. Track here #437 @trip-somers multiple discriminators are not working yet. Regarding your last issue. You should reference schema not parameter: @magnusros yes, this seems to be correct. Could you setup minimal reproducible sample so I can reproduce. |
great work, everything fixed except that subtle issue with scrolling |
@RomanGotsiy Thanks, Roman! I made the adjustments and everything looks good. The discriminator-selector issue I described is much better, but still has a weird behavior. Everything is functional and accurately displayed, but the initial selection is the 5th item (or -2 going backwards) on my list. Perfectly acceptable in an alpha release, though. |
Using the following OpenAPI schema with redoc 2.0.0.15 alpha, the externalDocs tag dos not show anything :
I understood that #103 added display of externalDocs item. The above schema has been validated against the openapi 3.0 schema. Thanks ! |
After changing from 1.x to 2.0.0-alpha.17 i have noticed the following problems: whenever i reference to an object, it only displays the name of the object, but not the corresponding attributes. I have noticed, that whenever something is of type object the child-attributes are missing. for example arrays of non-object types on the other hand show the child-attributes just fine. The default response type for all samples is incorrectly set to / but should be application/json. e.g. the following json still produces two available responses and selects the empty one first
|
similar to the comment by @Dalabad , update from
|
Overriding a definition property with a different type breaks Stacktrace:
Sample Spec:
|
Indented markdown in descriptions breaks ---
swagger: '2.0'
info:
title: API
version: v1
description: |
This is some description markdown
This markdown is indented so it's a code block
paths:
"/foo":
get:
produces:
- text/plain
|
Hello! I need some help troubleshooting an issue. I'm working on a React/yarn/webpack/babel application and followed the instructions in the "Usage as a React component" section on this page: https://github.com/Rebilly/ReDoc I did a "yarn add redoc" and got this in my package.json: "dependencies": { I then did the "Usage as a React component" steps, restarted my application, and I get this in the JavaScript console: [Error] TypeError: external_react_["createContext"] is not a function. (In 'external_react_["createContext"](new RedocNormalizedOptions_RedocNormalizedOptions({}))', 'external_react_["createContext"]' is undefined) Line 5913 of the anonymous function is the last line of this code: // EXTERNAL MODULE: external "dompurify" Has anyone seen this error before? Any ideas on why this is happening? Thank you! |
I believe the issue I'm seeing is due to my app using React 15. Looks like I need to upgrade to React 16, then ReDoc 2.x will work. |
Closing this issue as too loooong and unmanageable. Please, open separate issues! It's getting more stable! |
redoc@2.0.0-alpha.30 doesn't work with redoc-cli, cause mobx was moved to DevDependencies and it results in throwing an error "Cannot find module mobx" |
Leave any issues you found during testing
2.0.0-alpha.x
releases here (just not to make so much noise in #327)The text was updated successfully, but these errors were encountered: