ccouzens / keycloak-openapi

OpenAPI definitions for Keycloak's Admin API
168 stars 66 forks source link

Version 12 has 'object' as type, but should be array of type. #9

Closed frankhommers closed 3 years ago

frankhommers commented 3 years ago

I think it's a wider problem than only this, I think if you solve it for this, it will be solved for all:

In v12 this

Get identity providers GET /{realm}/identity-provider/instances

becomes an object in de openapi json.

But it was in v11 still an array of IdentityProviderRepresentation as it should be.

v12: https://github.com/ccouzens/keycloak-openapi/blob/b865c669d9c250b0ba1a26ada31616f4bec2326a/keycloak/12.0.json#L6963

v11: https://github.com/ccouzens/keycloak-openapi/blob/b865c669d9c250b0ba1a26ada31616f4bec2326a/keycloak/11.0.json#L7103

ccouzens commented 3 years ago

Hi @frankhommers ,

Thanks for reporting this 🙂

I've changed it so that Stream in keycloak's documentation produces the following json:

                 "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": true
                  }
                 }

I can't make it into an array of IdentityProviderRepresentation because the documentation doesn't have the information in it 🙁

Screenshot_2021-01-15 Keycloak Admin REST API

ccouzens commented 3 years ago

https://github.com/ccouzens/keycloak-openapi/compare/b865c669d9c250b0ba1a26ada31616f4bec2326a...5449ed5edb70f9693d9e120bed649decd576eaa1

frankhommers commented 3 years ago

Yeah I see it... In my opinion that's a bug in their documentation. This change to stream made it pretty useless :(

ccouzens commented 3 years ago

I've created a patched version of 12.0, so that these fixes can be made manually.

https://github.com/ccouzens/keycloak-openapi/blob/master/keycloak/12.0-patched.json

So far, it just fixes the return type of /{realm}/identity-provider/instances and /{realm}/clients.

I've also made a "help wanted" issue for someone other than me to continue making fixes such as this https://github.com/ccouzens/keycloak-openapi/issues/10

frankhommers commented 3 years ago

I did the same but for much more. I opened 12.json, 11.json and 10.json, and merged everything applicable into 12.json. I'll fork.