Sphereon-Opensource / pex-openapi

Decentralized Identity Foundation : Presentation Exchange : API
Apache License 2.0
1 stars 6 forks source link

How to deal with special characters? #32

Open TimoGlastra opened 7 months ago

TimoGlastra commented 7 months ago

The new vc+sd-jwt types in the PEX Models repository seems to be causing some trouble, as OpenAPI Generator strips/replaces special characters thus making the resulting interfaces not aligned with the prpoerties from the specification.

This is the case for vc+sd-jwt -> vcsd_jwt, as well as sd-jwt_alg_values -> sd_jwt_alg_values, and kb-jwt_alg_values -> kb_jwt_alg_values.

I've ran into this problem already years ago (https://github.com/OpenAPITools/openapi-generator/issues/4748), and it seems there's a lot of issues with this (e.g. https://github.com/OpenAPITools/openapi-generator/issues/6810, https://github.com/OpenAPITools/openapi-generator/issues/15261)

What would be the best way forward here? Should we do manual post-processing on the generated interfaces?

I did some tinkering with e.g. https://github.com/drwpow/openapi-typescript which seems to generate the properties correct, but doesn't output separate interfaces etc..

nklomp commented 7 months ago

Yeah we are doing some manual post processing currently.

We can solve this for typescript in some of the templates being used (we are already doing some template work).

Would be nice if you could list the different properties that have issues, then we will update thr documentation and also create a structural automatic approach for typescript.

TimoGlastra commented 7 months ago

Okay that sounds great, thanks

The properties I'm currently encountering issues with: