Casbin Forum runs on Casnode, the open-source Discourse-style forum. Try the Casnode demo →
Casbin Forum

howdy folks! i was just attempting to generate an api client from casdoor's swagger.json and ran into this: https://github.com/casdoor/casdoor/issues/2412

I left some detailed feedback about what I think is going on, but wanted to raise it to maintainers attention here as well (since it's not clear to me who i should ping on the issue or who might get notifications from my messages).

I'm also curious as to whether casdoor's swagger.json is somehow generated from casdoor code or if it's maintained manually by contributors

if it's manually maintained by contributors i could take a look at fixing it though i'm pretty much totally unfamiliar with casdoor code.

even if i were to fix it i would be somewhat concerned (if i were a maintainer, which of course i'm not) that it would simply get out-of-spec again in the future -- would it make sense to add a CI job that uses a strictly-adherent client code generator to identify those issues early?

1views
1 minread

hmm, does the casdoor http api return response codes other than 200 very often? it looks to me like even when there is a DB error of some kind it returns a http 200 with a json body containing a Status field set to "error"

i'm also wondering if the casdoor http API abstracts over transactions for any of the operations it performs...if not i might be better off just generating ORM code from the database itself and using that for non-OIDC interactions

hmm, yeah i'm finding tons of undocumented parameters in the beego docstring annotations, gonna try generating sea-orm code and just make sure that the code i write over that for interacting with the casdoor database is more or less doing the same thing as the casdoor api on an as-needed basis

i'll still submit a PR for adding responses where possible, i just don't have the attention span for addressing all the undocumented parameters (which i assume are necessary to generate proper api client code from the generated swagger)

oh...the entire casdoor schema is stringly typed... 😬

1 / 4
Nov 2023