swagger-api / swagger-api/swagger-codegen

csharp codegen defaults to https BasePath if scheme is not set in swagger source

Open
#7,653 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

Generating csharp 4.5 client code defaults the baseUrl to https, it should be configurable. I don't have access to how the swagger was generated so I can't set the scheme in the Json to http. I either have to run a filter on the swagger to insert the scheme prior to code generation or edit the code after it has been generated

Swagger-codegen version

2.3.1

        public Configuration()
        {
            UserAgent = "Swagger-Codegen/1.0.0/csharp";
            BasePath = "https://XXX.XXX.XXX.XX:10000/analytics/pricing/";
            DefaultHeader = new ConcurrentDictionary<string, string>();
            ApiKey = new ConcurrentDictionary<string, string>();
            ApiKeyPrefix = new ConcurrentDictionary<string, string>();

            // Setting Timeout has side effects (forces ApiClient creation).
            Timeout = 100000;
        }
Swagger declaration file content or url
{"swagger":"2.0","info":{"description":"Service wrapper for OpenGamma Strata","version":"0.0.2-SNAPSHOT","title":"Strata Analytics Service","termsOfService":"Terms of service","contact":{"name":"xxx","url":"https://xxx.com","email":"XXX@XXXpath.com"},"license":{"name":"Apache License Version 2.0","url":"https://www.apache.org/licenses/LICENSE-2.0"}},"host":"##.###.###.##:10000","basePath":"/analytics/pricing/","tags":[{"name":"fx-controller","description":"Fx Controller"},{"name":"ir-controller","description":"Ir Controller"}],"paths":{"/fx/forward/price":{"post":{"tags":["fx-controller"],"summary":"FX Forward - prices trade, returns NPV, cash exposure, delta, forward rate and spread","operationId":"priceFxForwardUsingPOST","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"fxForward","description":"fxForward","required":true,"schema":{"$ref":"#/definitions/FxSingleDto"}},{"name":"value-date","in":"query","description":"value-date","required":true,"type":"string","format":"date"},{"name":"instance","in":"query","description":"instance","required":true,"type":"string","enum":["CLOSE","LAST"]},{"name":"measure","in":"query","description":"measure","required":false,"type":"array","items":{"type":"string","enum":["NPV","SPREAD","CURRENCY_EXPOSURE","CASH","FORWARD_RATE","FAILURE","SPOT_RATE"]},"collectionFormat":"multi","enum":["NPV","SPREAD","CURRENCY_EXPOSURE","CASH","FORWARD_RATE","FAILURE","SPOT_RATE"]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/FxSingleDto"}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/fx/forward/sample":{"get":{"tags":["fx-controller"],"summary":"FX Forward - returns a sample trade","operationId":"getFxForwardSampleUsingGET","produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/FxSingleDto"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/fx/ndf/price":{"post":{"tags":["fx-controller"],"summary":"FX Non-deliverable Forward - prices trade, returns NPV, cash exposure, delta, forward rate and spread","operationId":"priceFxNdfUsingPOST","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"ndf","description":"ndf","required":true,"schema":{"$ref":"#/definitions/FxNdfDto"}},{"name":"value-date","in":"query","description":"value-date","required":true,"type":"string","format":"date"},{"name":"instance","in":"query","description":"instance","required":true,"type":"string","enum":["CLOSE","LAST"]},{"name":"measure","in":"query","description":"measure","required":false,"type":"array","items":{"type":"string","enum":["NPV","SPREAD","CURRENCY_EXPOSURE","CASH","FORWARD_RATE","FAILURE","SPOT_RATE"]},"collectionFormat":"multi","enum":["NPV","SPREAD","CURRENCY_EXPOSURE","CASH","FORWARD_RATE","FAILURE","SPOT_RATE"]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/FxNdfDto"}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/fx/ndf/sample":{"get":{"tags":["fx-controller"],"summary":"FX Non-Deliverable Forward - returns a sample trade","operationId":"getFxNdfSampleUsingGET","produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/FxNdfDto"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/fx/option/price":{"post":{"tags":["fx-controller"],"summary":"FX Vanilla Option - prices trade, returns NPV, cash exposure, forward rate and greeks","operationId":"priceFxOptionUsingPOST","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"fxOpt","description":"fxOpt","required":true,"schema":{"$ref":"#/definitions/FxVanillaOptionDto"}},{"name":"value-date","in":"query","description":"value-date","required":false,"type":"string","format":"date"},{"name":"instance","in":"query","description":"instance","required":false,"type":"string","enum":["CLOSE","LAST"]},{"name":"measure","in":"query","description":"measure","required":false,"type":"array","items":{"type":"string","enum":["NPV","SPREAD","CURRENCY_EXPOSURE","CASH","FORWARD_RATE","FAILURE","SPOT_RATE"]},"collectionFormat":"multi","enum":["NPV","SPREAD","CURRENCY_EXPOSURE","CASH","FORWARD_RATE","FAILURE","SPOT_RATE"]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/FxVanillaOptionDto"}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/fx/option/sample":{"get":{"tags":["fx-controller"],"summary":"FX Vanilla Option - returns a sample trade","operationId":"getFxOptionSampleUsingGET","produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/FxVanillaOptionDto"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/fx/spot/price":{"get":{"tags":["fx-controller"],"summary":"FX Spot - prices trade, returns NPV, cash exposure","operationId":"priceFxSpotUsingGET","produces":["application/json"],"parameters":[{"name":"base-currency","in":"query","description":"Base currency as a ISO4217 currency code","required":true,"type":"string"},{"name":"base-currency-amount","in":"query","description":"Notional in units of base currency","required":true,"type":"number"},{"name":"counter-currency","in":"query","description":"Counter currency as a ISO4217 currency code","required":true,"type":"string"},{"name":"value-date","in":"query","description":"value-date","required":true,"type":"string","format":"date"},{"name":"instance","in":"query","description":"instance","required":false,"type":"string","enum":["CLOSE","LAST"]},{"name":"measure","in":"query","description":"measure","required":false,"type":"array","items":{"type":"string","enum":["NPV","SPREAD","CURRENCY_EXPOSURE","CASH","FORWARD_RATE","FAILURE","SPOT_RATE"]},"collectionFormat":"multi","enum":["NPV","SPREAD","CURRENCY_EXPOSURE","CASH","FORWARD_RATE","FAILURE","SPOT_RATE"]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/FxSingleDto"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}},"post":{"tags":["fx-controller"],"summary":"FX Spot - prices trade, returns NPV, cash exposure","operationId":"priceFxSpotFromFxSingleUsingPOST","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"fxSpot","description":"fxSpot","required":true,"schema":{"$ref":"#/definitions/FxSingleDto"}},{"name":"value-date","in":"query","description":"value-date","required":true,"type":"string","format":"date"},{"name":"instance","in":"query","description":"instance","required":false,"type":"string","enum":["CLOSE","LAST"]},{"name":"measure","in":"query","description":"measure","required":false,"type":"array","items":{"type":"string","enum":["NPV","SPREAD","CURRENCY_EXPOSURE","CASH","FORWARD_RATE","FAILURE","SPOT_RATE"]},"collectionFormat":"multi","enum":["NPV","SPREAD","CURRENCY_EXPOSURE","CASH","FORWARD_RATE","FAILURE","SPOT_RATE"]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/FxSingleDto"}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/fx/swap/price":{"post":{"tags":["fx-controller"],"summary":"FX Swap - prices trade, returns NPV, cash exposure, delta, forward rate and spread","operationId":"priceFxSwapUsingPOST","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"fxSwap","description":"fxSwap","required":true,"schema":{"$ref":"#/definitions/FxSwapDto"}},{"name":"value-date","in":"query","description":"value-date","required":true,"type":"string","format":"date"},{"name":"instance","in":"query","description":"instance","required":true,"type":"string","enum":["CLOSE","LAST"]},{"name":"measure","in":"query","description":"measure","required":false,"type":"array","items":{"type":"string","enum":["NPV","SPREAD","CURRENCY_EXPOSURE","CASH","FORWARD_RATE","FAILURE","SPOT_RATE"]},"collectionFormat":"multi","enum":["NPV","SPREAD","CURRENCY_EXPOSURE","CASH","FORWARD_RATE","FAILURE","SPOT_RATE"]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/FxSwapDto"}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/fx/swap/sample":{"get":{"tags":["fx-controller"],"summary":"FX Swap - returns a sample trade","operationId":"getFxSwapSampleUsingGET","produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/FxSwapDto"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/fx/window-forward/price":{"post":{"tags":["fx-controller"],"summary":"FX Window Forward - prices trade, returns NPV, cash exposure, delta, forward rate and spread","operationId":"priceFxWindowForwardUsingPOST","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"fxWindowForward","description":"fxWindowForward","required":true,"schema":{"$ref":"#/definitions/FxWindowForwardDto"}},{"name":"value-date","in":"query","description":"value-date","required":true,"type":"string","format":"date"},{"name":"instance","in":"query","description":"instance","required":true,"type":"string","enum":["CLOSE","LAST"]},{"name":"measure","in":"query","description":"measure","required":false,"type":"array","items":{"type":"string","enum":["NPV","SPREAD","CURRENCY_EXPOSURE","CASH","FORWARD_RATE","FAILURE","SPOT_RATE"]},"collectionFormat":"multi","enum":["NPV","SPREAD","CURRENCY_EXPOSURE","CASH","FORWARD_RATE","FAILURE","SPOT_RATE"]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/FxWindowForwardDto"}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/fx/window-forward/sample":{"get":{"tags":["fx-controller"],"summary":"FX Window Forward - returns a sample trade","operationId":"getFxWindowForwardSampleUsingGET","produces":["application/json"],"parameters":[{"name":"generate-dates","in":"query","description":"set to 'true' to generate a sample date schedule, false to return window start and end dates","required":false,"type":"boolean","default":false}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/FxWindowForwardDto"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/ir/swap/price":{"post":{"tags":["ir-controller"],"summary":"Price an IR Swap","operationId":"priceIrSwapUsingPOST","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"swap","description":"swap","required":true,"schema":{"$ref":"#/definitions/SwapDto"}},{"name":"value-date","in":"query","description":"value-date","required":true,"type":"string","format":"date"},{"name":"instance","in":"query","description":"instance","required":true,"type":"string"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/SwapDto"}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/ir/swap/sample/fixed-libor3m":{"get":{"tags":["ir-controller"],"summary":"Return a sample of a fixed vs 3m Libor IR Swap","operationId":"getIrSwapSampleFixedLibor3mUsingGET","produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/SwapDto"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/ir/swap/sample/fixed-libor3m-stub":{"get":{"tags":["ir-controller"],"summary":"Return a sample of a IR Swap","operationId":"getIrSwapSampleUsingGET","produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/SwapDto"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}}},"definitions":{"AdjustableDateDto":{"type":"object","properties":{"adjustment":{"$ref":"#/definitions/BusinessDayAdjustmentDto"},"unadjusted":{"type":"string","format":"date"}},"title":"AdjustableDateDto"},"AdjustablePaymentDto":{"type":"object","properties":{"date":{"$ref":"#/definitions/AdjustableDateDto"},"value":{"$ref":"#/definitions/CurrencyAmountDto"}},"title":"AdjustablePaymentDto"},"BusinessDayAdjustmentDto":{"type":"object","properties":{"calendar":{"type":"array","items":{"type":"string"}},"convention":{"type":"string"}},"title":"BusinessDayAdjustmentDto"},"CashFlow":{"type":"object","properties":{"dayCountFraction":{"type":"number","format":"double"},"days":{"type":"integer","format":"int32"},"discFactor":{"type":"number","format":"double"},"endDate":{"type":"string","format":"date"},"endDateUnAdj":{"type":"integer","format":"int64"},"impliedVol":{"type":"number","format":"double"},"interest":{"type":"number","format":"double"},"isKnown":{"type":"boolean"},"notional":{"type":"number","format":"double"},"optDelta":{"type":"number","format":"double"},"optGamma":{"type":"number","format":"double"},"optValue":{"type":"number","format":"double"},"optVega":{"type":"number","format":"double"},"paymentDate":{"type":"string","format":"date"},"pmt":{"type":"number","format":"double"},"pmtpv":{"type":"number","format":"double"},"ppmt":{"type":"number","format":"double"},"rate":{"type":"number","format":"double"},"resetDate":{"type":"string","format":"date"},"scaler":{"type":"number","format":"double"},"spread":{"type":"number","format":"double"},"startDate":{"type":"string","format":"date"},"startDateUnAdj":{"type":"integer","format":"int64"},"strike":{"type":"number","format":"double"}},"title":"CashFlow"},"CurrencyAmountDto":{"type":"object","properties":{"amount":{"type":"number","format":"double"},"currency":{"type":"string"}},"title":"CurrencyAmountDto"},"FxNdfDto":{"type":"object","properties":{"agreedFxRate":{"$ref":"#/definitions/FxQuoteDto"},"buySell":{"type":"string","enum":["BUY","SELL"]},"clientId":{"type":"integer","format":"int64"},"ctptyTradeId":{"type":"string"},"ctptyVersionId":{"type":"string"},"index":{"type":"string"},"links":{"type":"array","xml":{"name":"link","namespace":"http://www.w3.org/2005/Atom","attribute":false,"wrapped":false},"items":{"$ref":"#/definitions/Link"}},"marketQuote":{"$ref":"#/definitions/MarketQuoteDto"},"paymentDate":{"type":"string","format":"date"},"pricerParams":{"type":"array","items":{"$ref":"#/definitions/PricerParam"}},"pricerResults":{"type":"array","items":{"$ref":"#/definitions/PricerResult"}},"settlementCurrencyNotional":{"$ref":"#/definitions/CurrencyAmountDto"},"settlementDate":{"type":"string","format":"date"},"status":{"type":"string"},"tradeDate":{"type":"string","format":"date"},"tradeId":{"type":"integer","format":"int64"}},"title":"FxNdfDto"},"FxQuoteDto":{"type":"object","properties":{"baseCurrency":{"type":"string"},"bid":{"type":"number"},"counterCurrency":{"type":"string"},"currency":{"type":"string"},"expiry":{"type":"string"},"links":{"type":"array","xml":{"name":"link","namespace":"http://www.w3.org/2005/Atom","attribute":false,"wrapped":false},"items":{"$ref":"#/definitions/Link"}},"mid":{"type":"number"},"offer":{"type":"number"},"quoteDate":{"type":"string","format":"date-time"},"quoteExpiry":{"type":"string","format":"date-time"},"rate":{"type":"number","format":"double"},"scale":{"type":"string","enum":["BPS","PERCENT","DECIMAL","TEN","HUNDRED","THOUSAND","TEN_THOUSAND","HUNDRED_THOUSAND","MILLION","BILLION"]},"scheme":{"type":"string"},"symbol":{"type":"string","enum":["BASIS_SWAP_USD_CAD","BASIS_SWAP_EUR_USD","BASIS_SWAP_GBP_USD","BASIS_SWAP_SONIA","BASIS_SWAP_EONIA","BASIS_SWAP_BMA_LIBOR","BASIS_SWAP_FEDFUNDS_LIBOR3M","BASIS_SWAP_LCH_CME","BASIS_SWAP_LIBOR_1M_3M","BASIS_SWAP_LIBOR_3M_6M","BASIS_SWAP_PRIME_LIBOR_3M","BOND_UST","CAPFLOOR_LIBOR_3M","FIXING_BMA","FIXING_FEDFUNDS","FIXING_LIBOR_1M","FIXING_LIBOR_3M","FIXING_LIBOR_6M","FIXING_PRIME","FRA_BA_3M","FRA_EURIBOR_6M","FRA_LIBOR_1M","FRA_LIBOR_3M","FRA_LIBOR_6M","FX_FORWARD_USD_CAD","FX_FORWARD_EUR_USD","FX_FORWARD_GBP_USD","FX_NDF_USD_CNY","FX_NDF_USD_ARS","FX_SPOT","SWAP_BA_3M_A5S3BA","SWAP_EURIBOR_6M_AB6ML","SWAP_LIBOR_6M_A5S6ML","SWAP_OIS_CORRA","SWAP_OIS_EONIA","SWAP_OIS_SONIA","SWAP_BMA","SWAP_LIBOR_SB3ML","SWAP_OIS","SWAPTION_LIBOR_3M","NONE"]},"tenor":{"type":"string"},"triangulationCurrency":{"type":"string"}},"title":"FxQuoteDto"},"FxSingleDto":{"type":"object","properties":{"baseCurrencyAmount":{"$ref":"#/definitions/CurrencyAmountDto"},"buySell":{"type":"string","enum":["BUY","SELL"]},"clientId":{"type":"integer","format":"int64"},"counterCurrencyAmount":{"$ref":"#/definitions/CurrencyAmountDto"},"ctptyTradeId":{"type":"string"},"ctptyVersionId":{"type":"string"},"links":{"type":"array","xml":{"name":"link","namespace":"http://www.w3.org/2005/Atom","attribute":false,"wrapped":false},"items":{"$ref":"#/definitions/Link"}},"marketQuote":{"$ref":"#/definitions/MarketQuoteDto"},"paymentDate":{"type":"string","format":"date"},"paymentDateAdjustment":{"$ref":"#/definitions/BusinessDayAdjustmentDto"},"pricerParams":{"type":"array","items":{"$ref":"#/definitions/PricerParam"}},"pricerResults":{"type":"array","items":{"$ref":"#/definitions/PricerResult"}},"settlementDate":{"type":"string","format":"date"},"status":{"type":"string"},"tradeDate":{"type":"string","format":"date"},"tradeId":{"type":"integer","format":"int64"}},"title":"FxSingleDto"},"FxSwapDto":{"type":"object","properties":{"buySell":{"type":"string","enum":["BUY","SELL"]},"clientId":{"type":"integer","format":"int64"},"ctptyTradeId":{"type":"string"},"ctptyVersionId":{"type":"string"},"farLeg":{"$ref":"#/definitions/FxSingleDto"},"links":{"type":"array","xml":{"name":"link","namespace":"http://www.w3.org/2005/Atom","attribute":false,"wrapped":false},"items":{"$ref":"#/definitions/Link"}},"marketQuote":{"$ref":"#/definitions/MarketQuoteDto"},"nearLeg":{"$ref":"#/definitions/FxSingleDto"},"pricerParams":{"type":"array","items":{"$ref":"#/definitions/PricerParam"}},"pricerResults":{"type":"array","items":{"$ref":"#/definitions/PricerResult"}},"settlementDate":{"type":"string","format":"date"},"status":{"type":"string"},"tradeDate":{"type":"string","format":"date"},"tradeId":{"type":"integer","format":"int64"}},"title":"FxSwapDto"},"FxVanillaOptionDto":{"type":"object","properties":{"buySell":{"type":"string","enum":["BUY","SELL"]},"clientId":{"type":"integer","format":"int64"},"ctptyTradeId":{"type":"string"},"ctptyVersionId":{"type":"string"},"expiryDateTime":{"type":"string","format":"date-time"},"links":{"type":"array","xml":{"name":"link","namespace":"http://www.w3.org/2005/Atom","attribute":false,"wrapped":false},"items":{"$ref":"#/definitions/Link"}},"longShort":{"type":"string"},"marketQuote":{"$ref":"#/definitions/MarketQuoteDto"},"premium":{"$ref":"#/definitions/AdjustablePaymentDto"},"pricerParams":{"type":"array","items":{"$ref":"#/definitions/PricerParam"}},"pricerResults":{"type":"array","items":{"$ref":"#/definitions/PricerResult"}},"settlementDate":{"type":"string","format":"date"},"status":{"type":"string"},"tradeDate":{"type":"string","format":"date"},"tradeId":{"type":"integer","format":"int64"},"underlying":{"$ref":"#/definitions/FxSingleDto"},"zone":{"type":"string"}},"title":"FxVanillaOptionDto"},"FxWindowForwardDto":{"type":"object","properties":{"baseCurrencyAmount":{"$ref":"#/definitions/CurrencyAmountDto"},"buySell":{"type":"string","enum":["BUY","SELL"]},"clientId":{"type":"integer","format":"int64"},"counterCurrencyAmount":{"$ref":"#/definitions/CurrencyAmountDto"},"ctptyTradeId":{"type":"string"},"ctptyVersionId":{"type":"string"},"earliestExecutionTime":{"type":"string"},"latestExecutionTime":{"type":"string"},"links":{"type":"array","xml":{"name":"link","namespace":"http://www.w3.org/2005/Atom","attribute":false,"wrapped":false},"items":{"$ref":"#/definitions/Link"}},"marketQuote":{"$ref":"#/definitions/MarketQuoteDto"},"paymentDate":{"type":"string","format":"date"},"paymentDateAdjustment":{"$ref":"#/definitions/BusinessDayAdjustmentDto"},"pricerParams":{"type":"array","items":{"$ref":"#/definitions/PricerParam"}},"pricerResults":{"type":"array","items":{"$ref":"#/definitions/PricerResult"}},"settlementDate":{"type":"string","format":"date"},"status":{"type":"string"},"tradeDate":{"type":"string","format":"date"},"tradeId":{"type":"integer","format":"int64"},"windowDates":{"type":"array","description":"Provided window dates, overrides windowStart and windowEnd","allowEmptyValue":false,"items":{"$ref":"#/definitions/WindowDateDto"}},"windowEnd":{"type":"string","format":"date","description":"End of the window period, must be after the windowStart and before the expiry date","allowEmptyValue":false},"windowStart":{"type":"string","format":"date","description":"Start of the window period, must be before the windowEnd and after the trade date","allowEmptyValue":false}},"title":"FxWindowForwardDto"},"Link":{"type":"object","properties":{"href":{"type":"string","xml":{"name":"href","attribute":true,"wrapped":false}},"rel":{"type":"string","xml":{"name":"rel","attribute":true,"wrapped":false}},"templated":{"type":"boolean"}},"title":"Link"},"MarketQuoteDto":{"type":"object","properties":{"bid":{"type":"number"},"currency":{"type":"string"},"expiry":{"type":"string"},"links":{"type":"array","xml":{"name":"link","namespace":"http://www.w3.org/2005/Atom","attribute":false,"wrapped":false},"items":{"$ref":"#/definitions/Link"}},"mid":{"type":"number"},"offer":{"type":"number"},"quoteDate":{"type":"string","format":"date-time"},"quoteExpiry":{"type":"string","format":"date-time"},"scale":{"type":"string","enum":["BPS","PERCENT","DECIMAL","TEN","HUNDRED","THOUSAND","TEN_THOUSAND","HUNDRED_THOUSAND","MILLION","BILLION"]},"scheme":{"type":"string"},"symbol":{"type":"string","enum":["BASIS_SWAP_USD_CAD","BASIS_SWAP_EUR_USD","BASIS_SWAP_GBP_USD","BASIS_SWAP_SONIA","BASIS_SWAP_EONIA","BASIS_SWAP_BMA_LIBOR","BASIS_SWAP_FEDFUNDS_LIBOR3M","BASIS_SWAP_LCH_CME","BASIS_SWAP_LIBOR_1M_3M","BASIS_SWAP_LIBOR_3M_6M","BASIS_SWAP_PRIME_LIBOR_3M","BOND_UST","CAPFLOOR_LIBOR_3M","FIXING_BMA","FIXING_FEDFUNDS","FIXING_LIBOR_1M","FIXING_LIBOR_3M","FIXING_LIBOR_6M","FIXING_PRIME","FRA_BA_3M","FRA_EURIBOR_6M","FRA_LIBOR_1M","FRA_LIBOR_3M","FRA_LIBOR_6M","FX_FORWARD_USD_CAD","FX_FORWARD_EUR_USD","FX_FORWARD_GBP_USD","FX_NDF_USD_CNY","FX_NDF_USD_ARS","FX_SPOT","SWAP_BA_3M_A5S3BA","SWAP_EURIBOR_6M_AB6ML","SWAP_LIBOR_6M_A5S6ML","SWAP_OIS_CORRA","SWAP_OIS_EONIA","SWAP_OIS_SONIA","SWAP_BMA","SWAP_LIBOR_SB3ML","SWAP_OIS","SWAPTION_LIBOR_3M","NONE"]},"tenor":{"type":"string"}},"title":"MarketQuoteDto"},"PricerParam":{"type":"object","properties":{"key":{"type":"string","enum":["PERCENTILE","PATHS","TIMESTEPS","RECOVERY_RATE_BANK","SPREAD_BANK","RECOVERY_RATE_COUNTERPARTY","SPREAD_COUNTERPARTY","QUALITY","VALUEDATE"]},"value":{"type":"string"}},"title":"PricerParam"},"PricerResult":{"type":"object","properties":{"currency":{"type":"string"},"failure":{"type":"string"},"result":{"type":"number","format":"double"},"resultDate":{"type":"string","format":"date"},"resultFormat":{"type":"string","enum":["BPS","CURRENCY","HEADER","NUMBER","RATE"]},"resultType":{"type":"string","enum":["NPV","SPREAD","CURRENCY_EXPOSURE","CASH","FORWARD_RATE","FAILURE","SPOT_RATE"]},"subResults":{"type":"array","items":{"$ref":"#/definitions/PricerResult"}}},"title":"PricerResult"},"SwapDto":{"type":"object","properties":{"adjustMaturity":{"type":"boolean"},"amortDayCount":{"type":"string"},"amortMonths":{"type":"number","format":"double"},"amortRate":{"type":"number","format":"double"},"amortType":{"type":"string"},"amortYears":{"type":"number","format":"double"},"backRollDate":{"type":"string","format":"date"},"buySell":{"type":"string","enum":["BUY","SELL"]},"clientId":{"type":"integer","format":"int64"},"ctptyTradeId":{"type":"string"},"ctptyVersionId":{"type":"string"},"customFlows":{"type":"boolean"},"effectiveDate":{"type":"string","format":"date"},"existing":{"type":"boolean"},"frontRollDate":{"type":"string","format":"date"},"links":{"type":"array","xml":{"name":"link","namespace":"http://www.w3.org/2005/Atom","attribute":false,"wrapped":false},"items":{"$ref":"#/definitions/Link"}},"marketQuote":{"$ref":"#/definitions/MarketQuoteDto"},"maturityDate":{"type":"string","format":"date"},"notional":{"type":"number","format":"double"},"pricerParams":{"type":"array","items":{"$ref":"#/definitions/PricerParam"}},"pricerResults":{"type":"array","items":{"$ref":"#/definitions/PricerResult"}},"relEffectiveDate":{"type":"string","format":"date"},"relMaturityDate":{"type":"string","format":"date"},"rollDay":{"type":"integer","format":"int32"},"settlementDate":{"type":"string","format":"date"},"status":{"type":"string"},"stubType":{"type":"string"},"swapLegs":{"type":"array","items":{"$ref":"#/definitions/SwapLegDto"}},"termMonths":{"type":"number","format":"double"},"termYears":{"type":"number","format":"double"},"tradeDate":{"type":"string","format":"date"},"tradeId":{"type":"integer","format":"int64"}},"title":"SwapDto"},"SwapLegDto":{"type":"object","properties":{"accruedInterest":{"type":"number","format":"double"},"adjustDates":{"type":"boolean"},"adjustMaturity":{"type":"boolean"},"avgFreq":{"type":"string"},"avgType":{"type":"string"},"backRollDate":{"type":"string","format":"date"},"cashFlows":{"type":"array","items":{"$ref":"#/definitions/CashFlow"}},"compFreq":{"type":"string"},"currency":{"type":"string"},"dayCount":{"type":"string"},"endOfMonth":{"type":"boolean"},"fixFlt":{"type":"string"},"frontRollDate":{"type":"string","format":"date"},"idxPct":{"type":"number","format":"double"},"index":{"type":"string"},"maturityDate":{"type":"string","format":"date"},"notional":{"type":"number","format":"double"},"payRec":{"type":"string"},"pymtConv":{"type":"string"},"pymtFreq":{"type":"string"},"pymtHoliday":{"type":"string"},"rate":{"type":"number","format":"double"},"relMaturityDate":{"type":"string"},"relStartDate":{"type":"string"},"resetBackRoll":{"type":"string"},"resetConv":{"type":"string"},"resetFreq":{"type":"string"},"resetFrontRoll":{"type":"string"},"resetHoliday":{"type":"string"},"resetLag":{"type":"integer","format":"int32"},"resetType":{"type":"string"},"rndDecimals":{"type":"integer","format":"int32"},"rndFraction":{"type":"number"},"rndMethod":{"type":"string"},"spread":{"type":"number","format":"double"},"startDate":{"type":"string","format":"date"},"weighted":{"type":"boolean"}},"title":"SwapLegDto"},"WindowDateDto":{"type":"object","properties":{"settlementDate":{"type":"string","format":"date"},"windowDate":{"type":"string","format":"date"}},"title":"WindowDateDto"}}}
Command line used for generation
java -i http://##.###.###.##:10000/analytics/pricing/v2/api-docs -l csharp -o c:/temp/Analytics-FX --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C} -c ./bin/csharp-analytics-net-45.json

csharp-analytics-net-45.json

{
	"packageName": "Com.XXXXXX.Analytics",
    "targetFramework": "v4.5"
}

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

Start at the C# 4.5 code-generation entry point that emits the Configuration constructor shown in the issue, and trace how a Swagger 2.0 definition without a scheme becomes BasePath. Verify the behavior with a definition containing host and basePath but no scheme, then confirm that the generated client can use a configurable scheme without editing generated code.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.