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
Wrong TypeScript type for Consent Request Session #12
Comments
Same problem for https://github.com/ory/sdk/blob/master/clients/hydra/typescript/model/consentRequest.ts#L27 The issue seems for when we can pass custom objects. |
Hm yeah, that's true. The definition comes from here: https://github.com/ory/hydra/blob/master/consent/types.go#L543 which is translated to: https://github.com/ory/hydra/blob/master/.schema/api.swagger.json#L2095-L2101 I think type |
Could you try and generate the typescript code and take the linked swagger.json and update the additionalProperties part? If that's causing the issue I guess we could open an issue in openapi-generator |
There's actually a new version available for openapi-generator so maybe it would be a good idea to bump it as it includes several bugfixes for TypeScript. It would also make sense to tag the version: |
I haven't tested, but it looks like the generated OpenAPI specification should actually be the following according to https://swagger.io/docs/specification/data-models/dictionaries/.
If that's true, that indicates the problem resides in the tool being used for generating the OpenAPI specification. |
Found the upstream: go-swagger/go-swagger#1402 |
I think this issue came back but for the Go client this time If in the openapi spec I remove the The sanitizer could remove the additionalProperties field for swagger specs https://github.com/ory/cli/blob/master/cmd/dev/swagger/sanitize.go#L96 spec from pet store "Pet": {
"description": "A pet for sale in the pet store",
"title": "a Pet",
"type": "object",
"properties": {
"access_token": {
"type": "object",
"x-go-name": "AccessToken"
},
"id_token": {
"type": "object",
"additionalProperties": {
"type": "object"
},
"x-go-name": "IDToken"
}
},
"xml": {
"name": "Pet"
}
}, // Pet A pet for sale in the pet store
type Pet struct {
AccessToken map[string]interface{} `json:"access_token,omitempty"`
IdToken map[string]map[string]interface{} `json:"id_token,omitempty"`
} Hydra issue related: ory/hydra#3058 |
sdk/clients/hydra/typescript/model/consentRequestSession.ts
Line 19 in f12e98e
should be:
sdk/clients/hydra/typescript/model/consentRequestSession.ts
Line 23 in f12e98e
should be:
Otherwise, it expects only empty objects.
The text was updated successfully, but these errors were encountered: