Errors with OpenAPI (not already existing atom)
Installed the new OpenAPI stuff earlier. Getting:
22 Replies
Also, great work! This has been on my list for a bit. Stoked to start using this.
😣that’s pretty strange
What’s the line number?
should be fixed, try main 😄
Also, FWIW, expect to find more than a few bumps on the road with the Open API stuff 😆
In the long term though I think there is lots of awesome potential there. I want to add support for
modify_json_schema(schema) -> schema
on Ash.Resource.Validation
structs. We can even do conditional application that way:
https://json-schema.org/understanding-json-schema/reference/conditionals.html#if-then-else```
i.e we have validate Validation1, where: [Validation2, Validation3]
Which we can map directly to if/then/else
LMK if main works for you BTWJust saw this, gimme 10 and I'll grab the new stuff and check.
no rush
Yup, looks great 👍
That brings up one thing I wanted to check into... Is there a way to override docs? Just tried with
@doc
@moduledoc
. First became interested in this for playground/GQL schema embedded docs.Beauty
This is still WIP for OpenAPI, right? I'm getting it through perfect in my GQL schema.
Honestly, I didn't do all of the initial work for the open api stuff. I checked the code before I merged it, but open api should definitely be seen as a work in progress, yes
Right on, wanted to make sure it wasn't a config issue on this end.
GitHub
ash_json_api/open_api.ex at main · ash-project/ash_json_api
A JSON:API extension for the Ash Framework. Contribute to ash-project/ash_json_api development by creating an account on GitHub.
so it looks like we honor the action description
but we don't do anything with attribute/argument descriptions:
https://github.com/ash-project/ash_json_api/blob/main/lib/ash_json_api/json_schema/open_api.ex#L200
GitHub
ash_json_api/open_api.ex at main · ash-project/ash_json_api
A JSON:API extension for the Ash Framework. Contribute to ash-project/ash_json_api development by creating an account on GitHub.
Yup, can confirm. Weirdly, it's the opposite way for GQL? I get my resource description on everything, but the actions descriptions aren't making it into the schema.
😂
Interesting
So your resource description should appear in the type, if thats where you are looking
i.e
listFoos -> Foo[]
clicking on Foo
should have the resource description
but yeah you're right, I don't see us using action descriptions in ash_graphqlI was grepping the output schema and checking playground to see if it gets picked up via intro.
Probably a pretty easy PR to make: https://github.com/ash-project/ash_graphql/blob/main/lib/resource/resource.ex#L428
GitHub
ash_graphql/resource.ex at main · ash-project/ash_graphql
An absinthe backed graphql API extension for the Ash Framework - ash_graphql/resource.ex at main · ash-project/ash_graphql
I get my resource description on both, though 😁
basically in that
mutations
and queries
function to produce the mutation/query fields, we'd add a description to the Field{}
structs produced from mutation.action.description
Yeah, something like that should do it 🙂
I forget if
mutation.action
is the actual action or just the atom name
so you might need to do:
Alright, had a chance to take a quick look at this.
GitHub
improvement: pass
description
through to Absinthe in more cases b...Check the TODO:s for a couple of additional places where adding descriptions would require supporting them in core. Operators maybe not relevant, but Ash.Resource.Calculation.Argument probably wort...