-
-
Notifications
You must be signed in to change notification settings - Fork 949
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
docs: schema fixes #2375
docs: schema fixes #2375
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. Unfortunately, this will not fix the problem as we generate the openapi schema from comments in the code. Instead, you will have to find and fix those.
Specifically you want to adjust
Lines 84 to 114 in 37f2f22
// ImageAttributes represents the attributes of an image node. | |
// | |
// swagger:model uiNodeImageAttributes | |
type ImageAttributes struct { | |
// The image's source URL. | |
// | |
// format: uri | |
// required: true | |
Source string `json:"src"` | |
// A unique identifier | |
// | |
// required: true | |
Identifier string `json:"id"` | |
// Width of the image | |
// | |
// required: true | |
Width int `json:"width"` | |
// Height of the image | |
// | |
// required: true | |
Height int `json:"height"` | |
// NodeType represents this node's types. It is a mirror of `node.type` and | |
// is primarily used to allow compatibility with OpenAPI 3.0. | |
// | |
// required: true | |
NodeType Type `json:"node_type"` | |
} |
Enums can be created like this: https://github.com/ory/keto/blob/d64ae29b5aa7359792c3515a771eefc093065f9b/internal/expand/tree.go#L15-L23
So you have to adjust
Lines 20 to 21 in 37f2f22
// swagger:model uiNodeType | |
type Type string |
You can test if your changes work by running make sdk
.
Thanks, I'll revise this tomorrow. |
I'm sorry, I'm not very familiar with Go and I don't know what I'm doing. I tried to turn uiNodeType on the node into an enum, but the output still looks wrong. |
That was a short night 😉 Swagger, the tool we use for generating the spec, is unfortunately very buggy. I think it only works if the enum name and the type name is the same. I'll quickly try that. |
Codecov Report
@@ Coverage Diff @@
## master #2375 +/- ##
=======================================
Coverage 76.61% 76.62%
=======================================
Files 315 315
Lines 17356 17358 +2
=======================================
+ Hits 13298 13300 +2
Misses 3122 3122
Partials 936 936
Continue to review full report at Codecov.
|
Thanks for fixing the enums! I couldn't stop myself... I pushed some more commits. As for the doc preview server, I didn't know why there are both I changed the When I run
I'm not sure what is happening. |
One more question, what is the reason for all the HTML tags like |
That's related to a tool we use for testing documentation https://github.com/kevgo/text-runner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, looks good to me. The CI failure does not seem related, but maybe rebase onto current master and let it run again?
.PHONY: docs/api | ||
docs/api: | ||
npx @redocly/openapi-cli preview-docs spec/api.json | ||
|
||
.PHONY: docs/swagger | ||
docs/swagger: | ||
npx @redocly/openapi-cli preview-docs spec/swagger.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that's nice 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is grand, thank you! Just two comments :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thank you! 🎉 Your contribution makes Ory better :)
Hello @woylie |
Closes ory#2357 Co-authored-by: zepatrik <zepatrik@users.noreply.github.com>
This PR updates the API schema.
resolves #2357
uiNodeType
into enumuiNodeGroup
into enumattributes.node_type
matches actual node_type value (see screenshot)api.openapi.json
, theLoginFlow
and theVerificationFlow
listtype
as a required property. The other flows don't, and none of the flows inopenapi.json
list it. I assume the type should always be set to either"api"
or"browser"
and never be omitted ornull
. Is that so? If so, I'll addtype
as a required property to all the flows.Checklist
introduces a new feature.
contributing code guidelines.
vulnerability. If this pull request addresses a security. vulnerability, I
confirm that I got green light (please contact
security@ory.sh) from the maintainers to push
the changes.
works.