equinix / equinix-sdk-go

Golang client for Equinix APIs
https://deploy.equinix.com/labs/equinix-sdk-go
MIT License
2 stars 4 forks source link

[Metal] Remove AuthTokenUser and AuthTokenProject models #66

Open ctreatma opened 4 days ago

ctreatma commented 4 days ago

Copied from https://github.com/equinix-labs/metal-go/issues/120.

We have an unnecessary AuthTokenUser model that is identical to the User model aside from the description. There is also an unnecessary AuthTokenProject model that is identical to the Project model aside from the description.

These models are generated because the AuthToken spec uses allOf to inject a description for the user and project properties for documentation purposes. This kind of structure is fine for redoc, but doesn't work well with code generators.

We need to find a different way to indicate that user tokens have a user and project tokens have a project that doesn't result in the creation of unnecessary duplicate models.

ctreatma commented 4 days ago

There may be generator options that would automatically determine that the only difference between the duplicate models mentioned in this issue is the description (which does not impact the model interface) and consolidate them (in fact, I could've sworn that behavior was added to the generator as default behavior and had resulted in model consolidation elsewhere...but I don't have proof of that handy).