OpenAPITools / OpenAPITools/openapi-generator

Rust: Stripe open api spec v3 does not compile

Open
#7,975 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Hello,

The Stripe open api v3 spec does not compile with Rust code gen:

Steps to reproduce:

  • openapi-generator generate -i ./openapi/spec3.json -g rust -o ./openapi-generator/rust-spec-3
  • cd ./openapi-generator/rust-spec-3
  • cargo build

cargo build errors:

error[E0428]: the name `EtcGMT0` is defined multiple times
error[E0428]: the name `EtcGMT1` is defined multiple times
error[E0428]: the name `EtcGMT10` is defined multiple times
error[E0428]: the name `EtcGMT11` is defined multiple times
error[E0428]: the name `EtcGMT12` is defined multiple times
error[E0428]: the name `EtcGMT2` is defined multiple times
error[E0428]: the name `EtcGMT3` is defined multiple times
error[E0428]: the name `EtcGMT4` is defined multiple times
error[E0428]: the name `EtcGMT5` is defined multiple times
error[E0428]: the name `EtcGMT6` is defined multiple times
error[E0428]: the name `EtcGMT7` is defined multiple times
error[E0428]: the name `EtcGMT8` is defined multiple times
error[E0428]: the name `EtcGMT9` is defined multiple times
error[E0428]: the name `GMT0` is defined multiple times
error[E0433]: failed to resolve: `crate` in paths can only be used in start position
error[E0433]: failed to resolve: could not find `serde_json` in `models`
error[E0412]: cannot find type `AnyOfpaymentSourcedeletedPaymentSource` in module `crate::models`
error[E0412]: cannot find type `AnyOfcustomerdeletedCustomer` in module `crate::models`
error[E0412]: cannot find type `AnyOfrecipientdeletedRecipient` in module `crate::models`
error[E0412]: cannot find type `AnyOfskudeletedSku` in module `crate::models`
error[E0412]: cannot find type `AnyOfcardbankAccountsource` in module `crate::models`
error[E0412]: cannot find type `AnyOfaccountBusinessProfile` in module `crate::models`
error[E0412]: cannot find type `AnyOfaccountSettings` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringfile` in module `crate::models`
error[E0412]: cannot find type `AnyOfaddress` in module `crate::models`
error[E0412]: cannot find type `AnyOfarraystring` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringcustomerdeletedCustomer` in module `crate::models`
error[E0412]: cannot find type `AnyOfbankAccountcardsource` in module `crate::models`
error[E0412]: cannot find type `AnyOfalipayAccountbankAccountbitcoinReceivercardsource` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringaccount` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringapplication` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringbalanceTransaction` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringcharge` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringapplicationFeechargeconnectCollectionTransferdisputefeeRefundissuingAuthorizationissuingDisputeissuingTransactionpayoutplatformTaxFeerefundreserveTransactiontaxDeductedAtSourcetopuptransfertransferReversal` in module `crate::models`
error[E0412]: cannot find type `AnyOfobjectstring` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringrecipient` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringapplicationFee` in module `crate::models`
error[E0412]: cannot find type `AnyOfchargeFraudDetails` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringinvoice` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringorder` in module `crate::models`
error[E0412]: cannot find type `AnyOfchargeOutcome` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringpaymentIntent` in module `crate::models`
error[E0412]: cannot find type `AnyOfpaymentMethodDetails` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringreview` in module `crate::models`
error[E0412]: cannot find type `AnyOfshipping` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringtransfer` in module `crate::models`
error[E0412]: cannot find type `AnyOfchargeTransferData` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringrule` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringsetupIntent` in module `crate::models`
error[E0412]: cannot find type `AnyOfpaymentPagesPaymentPageResourcesShippingAddressCollection` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringsubscription` in module `crate::models`
error[E0412]: cannot find type `AnyOfpaymentPagesCheckoutSessionTotalDetails` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringcustomerBalanceTransaction` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringrefund` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringtaxRate` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringalipayAccountbankAccountbitcoinReceivercardsource` in module `crate::models`
error[E0412]: cannot find type `AnyOfdiscount` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringcreditNote` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringcustomer` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringpromotionCode` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringdiscountdeletedDiscount` in module `crate::models`
error[E0412]: cannot find type `AnyOfnotificationEventRequest` in module `crate::models`
error[E0412]: cannot find type `AnyOfbankAccountcard` in module `crate::models`
error[E0412]: cannot find type `AnyOfmapstring` in module `crate::models`
error[E0412]: cannot find type `AnyOfintegerstring` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringstring` in module `crate::models`
error[E0412]: cannot find type `AnyOfobjectobject` in module `crate::models`
error[E0412]: cannot find type `AnyOfbooleanstring` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringinteger` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringintegerstring` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringpaymentMethod` in module `crate::models`
error[E0412]: cannot find type `AnyOfapiErrors` in module `crate::models`
error[E0412]: cannot find type `AnyOfinvoiceTransferData` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringdiscount` in module `crate::models`
error[E0412]: cannot find type `AnyOfprice` in module `crate::models`
error[E0412]: cannot find type `AnyOfissuingAuthorizationAmountDetails` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringissuingCardholder` in module `crate::models`
error[E0412]: cannot find type `AnyOfissuingAuthorizationPendingRequest` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringissuingCard` in module `crate::models`
error[E0412]: cannot find type `AnyOfissuingCardShipping` in module `crate::models`
error[E0412]: cannot find type `AnyOfissuingCardholderCompany` in module `crate::models`
error[E0412]: cannot find type `AnyOfissuingCardholderIndividual` in module `crate::models`
error[E0412]: cannot find type `AnyOfissuingCardholderAuthorizationControls` in module `crate::models`
error[E0412]: cannot find type `AnyOfissuingCardholderIndividualDob` in module `crate::models`
error[E0412]: cannot find type `AnyOfissuingCardholderVerification` in module `crate::models`
error[E0412]: cannot find type `AnyOfissuingCardholderIdDocument` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringissuingTransaction` in module `crate::models`
error[E0412]: cannot find type `AnyOfissuingTransactionAmountDetails` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringissuingAuthorization` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringissuingDispute` in module `crate::models`
error[E0412]: cannot find type `AnyOfissuingTransactionPurchaseDetails` in module `crate::models`
error[E0412]: cannot find type `AnyOfissuingTransactionFlightData` in module `crate::models`
error[E0412]: cannot find type `AnyOfissuingTransactionFuelData` in module `crate::models`
error[E0412]: cannot find type `AnyOfissuingTransactionLodgingData` in module `crate::models`
error[E0412]: cannot find type `AnyOflegalEntityJapanAddress` in module `crate::models`
error[E0412]: cannot find type `AnyOflegalEntityCompanyVerification` in module `crate::models`
error[E0412]: cannot find type `AnyOflegalEntityPersonVerificationDocument` in module `crate::models`
error[E0412]: cannot find type `AnyOfstatusTransitions` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringsku` in module `crate::models`
error[E0412]: cannot find type `AnyOfobjectinteger` in module `crate::models`
error[E0412]: cannot find type `AnyOfpaymentIntentNextAction` in module `crate::models`
error[E0412]: cannot find type `AnyOfpaymentIntentPaymentMethodOptions` in module `crate::models`
error[E0412]: cannot find type `AnyOftransferData` in module `crate::models`
error[E0412]: cannot find type `AnyOfpaymentMethodOptionsCardInstallments` in module `crate::models`
error[E0412]: cannot find type `AnyOfpaymentMethodCardChecks` in module `crate::models`
error[E0412]: cannot find type `AnyOfpaymentMethodCardGeneratedCard` in module `crate::models`
error[E0412]: cannot find type `AnyOfnetworks` in module `crate::models`
error[E0412]: cannot find type `AnyOfthreeDSecureUsage` in module `crate::models`
error[E0412]: cannot find type `AnyOfpaymentMethodCardWallet` in module `crate::models`
error[E0412]: cannot find type `AnyOfcardGeneratedFromPaymentMethodDetails` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringmandate` in module `crate::models`
error[E0412]: cannot find type `AnyOfpaymentMethodDetailsCardChecks` in module `crate::models`
error[E0412]: cannot find type `AnyOfpaymentMethodDetailsCardInstallments` in module `crate::models`
error[E0412]: cannot find type `AnyOfthreeDSecureDetails` in module `crate::models`
error[E0412]: cannot find type `AnyOfpaymentMethodDetailsCardWallet` in module `crate::models`
error[E0412]: cannot find type `AnyOfpaymentMethodDetailsCardInstallmentsPlan` in module `crate::models`
error[E0412]: cannot find type `AnyOfpaymentMethodDetailsCardPresentReceipt` in module `crate::models`
error[E0412]: cannot find type `AnyOfpaymentMethodDetailsInteracPresentReceipt` in module `crate::models`
error[E0412]: cannot find type `AnyOfsepaDebitGeneratedFrom` in module `crate::models`
error[E0412]: cannot find type `AnyOfsourceOwner` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringbankAccountcarddeletedBankAccountdeletedCard` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringpayout` in module `crate::models`
error[E0412]: cannot find type `AnyOfpersonRequirements` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringproductdeletedProduct` in module `crate::models`
error[E0412]: cannot find type `AnyOftransformUsage` in module `crate::models`
error[E0412]: cannot find type `AnyOfrecurring` in module `crate::models`
error[E0412]: cannot find type `AnyOftransformQuantity` in module `crate::models`
error[E0412]: cannot find type `AnyOfpackageDimensions` in module `crate::models`
error[E0412]: cannot find type `AnyOfbankAccount` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringcard` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringtransferReversal` in module `crate::models`
error[E0412]: cannot find type `AnyOfnumberstring` in module `crate::models`
error[E0412]: cannot find type `AnyOffile` in module `crate::models`
error[E0412]: cannot find type `AnyOfradarReviewResourceLocation` in module `crate::models`
error[E0412]: cannot find type `AnyOfradarReviewResourceSession` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringsetupAttempt` in module `crate::models`
error[E0412]: cannot find type `AnyOfsetupIntentNextAction` in module `crate::models`
error[E0412]: cannot find type `AnyOfsetupIntentPaymentMethodOptions` in module `crate::models`
error[E0412]: cannot find type `AnyOfdeliveryEstimate` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringproduct` in module `crate::models`
error[E0412]: cannot find type `AnyOfsubscriptionBillingThresholds` in module `crate::models`
error[E0412]: cannot find type `AnyOfsubscriptionsResourcePauseCollection` in module `crate::models`
error[E0412]: cannot find type `AnyOfsubscriptionPendingInvoiceItemInterval` in module `crate::models`
error[E0412]: cannot find type `AnyOfsubscriptionsResourcePendingUpdate` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringsubscriptionSchedule` in module `crate::models`
error[E0412]: cannot find type `AnyOfsubscriptionTransferData` in module `crate::models`
error[E0412]: cannot find type `AnyOfsubscriptionItemBillingThresholds` in module `crate::models`
error[E0412]: cannot find type `AnyOfsubscriptionScheduleCurrentPhase` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringpricedeletedPrice` in module `crate::models`
error[E0412]: cannot find type `AnyOfstringcoupondeletedCoupon` in module `crate::models`
error[E0412]: cannot find type `AnyOfinvoiceSettingSubscriptionScheduleSetting` in module `crate::models`
error[E0412]: cannot find type `AnyOftaxIdVerification` in module `crate::models`
error[E0599]: no method named `join` found for reference `&str` in the current scope
error[E0599]: no method named `to_string` found for reference `&models::all_people_relationship_specs::AllPeopleRelationshipSpecs` in the current scope
error[E0599]: no method named `to_string` found for reference `&models::all_people_relationship_specs_1::AllPeopleRelationshipSpecs1` in the current scope
error[E0599]: no method named `to_string` found for reference `&models::all_people_relationship_specs_2::AllPeopleRelationshipSpecs2` in the current scope
error[E0599]: no method named `to_string` found for reference `&models::all_people_relationship_specs_3::AllPeopleRelationshipSpecs3` in the current scope
error[E0599]: no method named `join` found for reference `&std::vec::Vec<models::credit_note_line_item_params::CreditNoteLineItemParams>` in the current scope
error[E0599]: no method named `to_string` found for reference `&std::collections::HashMap<std::string::String, std::string::String>` in the current scope
error[E0599]: no method named `join` found for reference `&std::vec::Vec<models::invoice_item_preview_params::InvoiceItemPreviewParams>` in the current scope
error[E0599]: no method named `join` found for reference `&std::vec::Vec<models::subscription_item_update_params::SubscriptionItemUpdateParams>` in the current scope
error[E0599]: no method named `to_string` found for reference `&models::order_timestamp_specs::OrderTimestampSpecs` in the current scope
error[E0599]: no method named `to_string` found for reference `&models::all_prices_recurring_params::AllPricesRecurringParams` in the current scope
error[E0599]: no method named `join` found for struct `std::vec::Vec<models::discount_params::DiscountParams>` in the current scope
error[E0599]: no method named `join` found for struct `std::vec::Vec<models::line_item_params::LineItemParams>` in the current scope
error[E0599]: no method named `join` found for struct `std::vec::Vec<models::credit_note_line_item_params::CreditNoteLineItemParams>` in the current scope
error[E0599]: no method named `join` found for struct `std::vec::Vec<models::data_params::DataParams>` in the current scope
error[E0599]: no method named `join` found for struct `std::vec::Vec<i32>` in the current scope
error[E0599]: no method named `join` found for struct `std::vec::Vec<models::add_invoice_item_entry::AddInvoiceItemEntry>` in the current scope
error[E0599]: no method named `join` found for struct `std::vec::Vec<models::subscription_item_create_params::SubscriptionItemCreateParams>` in the current scope
error[E0599]: no method named `join` found for struct `std::vec::Vec<models::subscription_item_update_params::SubscriptionItemUpdateParams>` in the current scope
error[E0599]: no method named `join` found for struct `std::vec::Vec<models::order_item_specs::OrderItemSpecs>` in the current scope
error[E0599]: no method named `join` found for struct `std::vec::Vec<models::tier::Tier>` in the current scope
error[E0599]: no method named `join` found for struct `std::vec::Vec<models::phase_configuration_params::PhaseConfigurationParams>` in the current scope
error[E0599]: no method named `join` found for struct `std::vec::Vec<models::phase_configuration_params_1::PhaseConfigurationParams1>` in the current scope
error[E0282]: type annotations needed

Versions

  • openapi-generator version

    • 4.3.1
  • cargo version

    • cargo 1.46.0 (149022b1d 2020-07-17)
  • https://github.com/stripe/openapi

    • Commit: fec5f44b

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce with openapi-generator using ./openapi/spec3.json and the rust generator, then enter ./openapi-generator/rust-spec-3 and run cargo build. Inspect the generated models and the reported duplicate definitions, unresolved crate paths, missing serde_json module, and missing AnyOf types. Done means the generated Stripe client builds successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, rust
Domain
api, tooling
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.