kcable194 / squareup

Squareup SDK for Rust
MIT License
3 stars 5 forks source link

CatalogItem variations is wrong type #16

Closed andrewbaxter closed 4 months ago

andrewbaxter commented 4 months ago
    /// A list of [CatalogItemVariation] objects for this item. An item must have at least one
    /// variation.
    pub variations: Option<Vec<CatalogObject>>,

I think this should be CatalogItemVariation instead of CatalogObject. This may be an issue with the openapi spec...

I take it this is generated from the spec? Is there a way to patch the spec or the generated code? I'd be happy to make an MR, but might need some direction on where to make the change so it doesn't get overridden later.

andrewbaxter commented 4 months ago

Ah, CatalogObject with type: ItemVariation I think, and I'm not sure what the model CatalogItemVariation is used for. Sorry for the noise!

kcable194 commented 4 months ago

Oh okay, no worries! You might be right though, I'll go through the Square docs this afternoon and double check.

Last time I checked, the version of openapi that Square uses doesn't support Rust. Everything in this crate has been written or copied and pasted from Square's docs. This definitely leaves room for human error.

andrewbaxter commented 4 months ago

Ah no definitely don't waste a second on this. If I actually find an issue I'll come back with something more concrete.

I just spent a couple hours going through terraform providers, the now archived go client, openapi code generators, square's unvalidated openapi spec, and then to rust client libraries and my brain's fried.