Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code generation using swagger / openapi specification file #82

Closed
vplme opened this issue Nov 10, 2018 · 4 comments
Closed

Code generation using swagger / openapi specification file #82

vplme opened this issue Nov 10, 2018 · 4 comments

Comments

@vplme
Copy link

vplme commented Nov 10, 2018

Hi,

I tried to use the openapi-generator-cli to generate a client for the bunq api using the provided swagger/openapi specification file (https://raw.githubusercontent.com/bunq/doc/master/swagger.json) but I am having trouble with the code generation.

How are the bunq sdks (python, php, csharp) generated? Are they also using the openapi generator?

Code generation

Using the following command:

java -jar openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/bunq/doc/master/swagger.json -g go -o ./bunq

Gives me the following error output:

java.net.URISyntaxException: Illegal character in path at index 36: https://public-api.sandbox.bunq.com/{basePath}
	at java.net.URI$Parser.fail(URI.java:2848)
	at java.net.URI$Parser.checkChars(URI.java:3021)
	at java.net.URI$Parser.parseHierarchical(URI.java:3105)
	at java.net.URI$Parser.parse(URI.java:3053)
	at java.net.URI.<init>(URI.java:588)
	at io.swagger.v3.parser.util.OpenAPIDeserializer.getServer(OpenAPIDeserializer.java:397)
	at io.swagger.v3.parser.util.OpenAPIDeserializer.getServersList(OpenAPIDeserializer.java:363)
	at io.swagger.v3.parser.util.OpenAPIDeserializer.parseRoot(OpenAPIDeserializer.java:157)
	at io.swagger.v3.parser.util.OpenAPIDeserializer.deserialize(OpenAPIDeserializer.java:111)
	at io.swagger.v3.parser.OpenAPIV3Parser.readWithInfo(OpenAPIV3Parser.java:104)
	at io.swagger.v3.parser.OpenAPIV3Parser.readWithInfo(OpenAPIV3Parser.java:142)
	at io.swagger.v3.parser.OpenAPIV3Parser.readLocation(OpenAPIV3Parser.java:45)
	at io.swagger.parser.OpenAPIParser.readLocation(OpenAPIParser.java:19)
	at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:552)
	at org.openapitools.codegen.cmd.Generate.run(Generate.java:348)
	at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:62)
java.net.URISyntaxException: Illegal character in path at index 21: https://api.bunq.com/{basePath}
	at java.net.URI$Parser.fail(URI.java:2848)
	at java.net.URI$Parser.checkChars(URI.java:3021)
	at java.net.URI$Parser.parseHierarchical(URI.java:3105)
	at java.net.URI$Parser.parse(URI.java:3053)
	at java.net.URI.<init>(URI.java:588)
	at io.swagger.v3.parser.util.OpenAPIDeserializer.getServer(OpenAPIDeserializer.java:397)
	at io.swagger.v3.parser.util.OpenAPIDeserializer.getServersList(OpenAPIDeserializer.java:363)
	at io.swagger.v3.parser.util.OpenAPIDeserializer.parseRoot(OpenAPIDeserializer.java:157)
	at io.swagger.v3.parser.util.OpenAPIDeserializer.deserialize(OpenAPIDeserializer.java:111)
	at io.swagger.v3.parser.OpenAPIV3Parser.readWithInfo(OpenAPIV3Parser.java:104)
	at io.swagger.v3.parser.OpenAPIV3Parser.readWithInfo(OpenAPIV3Parser.java:142)
	at io.swagger.v3.parser.OpenAPIV3Parser.readLocation(OpenAPIV3Parser.java:45)
	at io.swagger.parser.OpenAPIParser.readLocation(OpenAPIParser.java:19)
	at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:552)
	at org.openapitools.codegen.cmd.Generate.run(Generate.java:348)
	at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:62)
Exception in thread "main" org.openapitools.codegen.SpecValidationException: There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI).
 | Error count: 52, Warning count: 2
Errors: 
	-attribute components.schemas.NoteAttachmentIdealMerchantTransaction_5be1e76160c9d.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentPayment_5be1e76173c42.properties is not of type `object`
	-attribute components.schemas.DraftShareInviteApiKeyQrCodeContent_5be1e75ebc5ad.properties is not of type `object`
	-attribute components.schemas.TabQrCodeContent_5be1e765a27f4.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentPaymentBatch_5be1e7616bfd1.properties is not of type `object`
	-attribute components.schemas.TabUsageSingle_5be1e765ac20a.properties is not of type `object`
	-attribute components.schemas.NoteTextSofortMerchantTransaction_5be1e7618aa66.properties is not of type `object`
	-attribute components.schemas.AttachmentTab.properties is not of type `object`
	-attribute components.schemas.TabUsageMultiple_5be1e765a522c.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentScheduleInstance_5be1e761841b9.properties is not of type `object`
	-attribute components.schemas.NoteTextWhitelistResult_5be1e7618e74b.properties is not of type `object`
	-attribute components.schemas.NoteTextMasterCardAction_5be1e7616a142.properties is not of type `object`
	-attribute components.schemas.NoteTextIdealMerchantTransaction_5be1e7616501a.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentBunqMeFundraiserResult_5be1e76159505.properties is not of type `object`
	-attribute components.schemas.AttachmentPublicContent_5be1e75e5b254.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentRequestInquiryBatch_5be1e76177e58.properties is not of type `object`
	-attribute components.schemas.ScheduleUser_5be1e765663e0.properties is not of type `object`
	-attribute components.schemas.AttachmentConversationContent_5be1e75e5a571.properties is not of type `object`
	-attribute components.schemas.NoteTextRequestResponse_5be1e761824fb.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentBankSwitchServiceNetherlandsIncomingPayment_5be1e76154f08.properties is not of type `object`
	-attribute components.schemas.Session_5be1e7657b84d.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentMasterCardAction_5be1e7616704c.properties is not of type `object`
	-attribute components.schemas.TabItemShop_5be1e7657fc43.properties is not of type `object`
	-attribute components.schemas.NoteTextDraftPayment_5be1e7615f12c.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentWhitelistResult_5be1e7618c958.properties is not of type `object`
	-attribute components.schemas.ExportAnnualOverview_5be1e76103da1.properties is not of type `object`
	-attribute components.schemas.DraftShareInviteBankQrCodeContent_5be1e75ebf101.properties is not of type `object`
	-attribute components.schemas.SchedulePaymentBatch_5be1e7652e387.properties is not of type `object`
	-attribute components.schemas.CertificatePinned_5be1e75e979d5.properties is not of type `object`
	-attribute components.schemas.SandboxUser.properties is not of type `object`
	-attribute components.schemas.SchedulePayment_5be1e76537a3a.properties is not of type `object`
	-attribute components.schemas.AttachmentTabContent_5be1e75e5bb2d.properties is not of type `object`
	-attribute components.schemas.ExportAnnualOverviewContent_5be1e761027be.properties is not of type `object`
	-attribute components.schemas.NoteTextRequestInquiryBatch_5be1e7617a11c.properties is not of type `object`
	-attribute components.schemas.CustomerStatementExportContent_5be1e761051d6.properties is not of type `object`
	-attribute components.schemas.AttachmentPublic.properties is not of type `object`
	-attribute components.schemas.NoteTextScheduleInstance_5be1e76186266.properties is not of type `object`
	-attribute components.schemas.Whitelist_5be1e75f4f26d.properties is not of type `object`
	-attribute components.schemas.CashRegisterQrCodeContent_5be1e75e85b04.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentRequestResponse_5be1e7618030d.properties is not of type `object`
	-attribute components.schemas.NoteTextPayment_5be1e76175f59.properties is not of type `object`
	-attribute components.schemas.TabAttachmentTabContent_5be1e75e5c5bf.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentRequestInquiry_5be1e7617bdb3.properties is not of type `object`
	-attribute components.schemas.NoteTextPaymentBatch_5be1e76171b90.properties is not of type `object`
	-attribute components.schemas.AttachmentMonetaryAccount.properties is not of type `object`
	-attribute components.schemas.CustomerStatementExport_5be1e761085da.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentSofortMerchantTransaction_5be1e76188575.properties is not of type `object`
	-attribute components.schemas.NoteTextRequestInquiry_5be1e7617dea5.properties is not of type `object`
	-attribute components.schemas.ShareInviteBankAmountUsed_5be1e7610d237.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentDraftPayment_5be1e7615cd09.properties is not of type `object`
	-attribute components.schemas.NoteTextBankSwitchServiceNetherlandsIncomingPayment_5be1e7615755e.properties is not of type `object`
	-attribute components.schemas.NoteTextBunqMeFundraiserResult_5be1e7615b22c.properties is not of type `object`
Warnings: 
	-Unused model: Avatar_5be1e75e3de25
	-Unused model: Tab_5be1e75f49f9e

	at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:569)
	at org.openapitools.codegen.cmd.Generate.run(Generate.java:348)
	at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:62)

Validation

Trying to validate the openapi file gives the following errors:

java -jar openapi-generator-cli.jar validate -i https://raw.githubusercontent.com/bunq/doc/master/swagger.json
Validating spec (https://raw.githubusercontent.com/bunq/doc/master/swagger.json)
java.net.URISyntaxException: Illegal character in path at index 36: https://public-api.sandbox.bunq.com/{basePath}
	at java.net.URI$Parser.fail(URI.java:2848)
	at java.net.URI$Parser.checkChars(URI.java:3021)
	at java.net.URI$Parser.parseHierarchical(URI.java:3105)
	at java.net.URI$Parser.parse(URI.java:3053)
	at java.net.URI.<init>(URI.java:588)
	at io.swagger.v3.parser.util.OpenAPIDeserializer.getServer(OpenAPIDeserializer.java:397)
	at io.swagger.v3.parser.util.OpenAPIDeserializer.getServersList(OpenAPIDeserializer.java:363)
	at io.swagger.v3.parser.util.OpenAPIDeserializer.parseRoot(OpenAPIDeserializer.java:157)
	at io.swagger.v3.parser.util.OpenAPIDeserializer.deserialize(OpenAPIDeserializer.java:111)
	at io.swagger.v3.parser.OpenAPIV3Parser.readWithInfo(OpenAPIV3Parser.java:104)
	at io.swagger.v3.parser.OpenAPIV3Parser.readWithInfo(OpenAPIV3Parser.java:142)
	at io.swagger.v3.parser.OpenAPIV3Parser.readLocation(OpenAPIV3Parser.java:45)
	at io.swagger.parser.OpenAPIParser.readLocation(OpenAPIParser.java:19)
	at org.openapitools.codegen.cmd.Validate.run(Validate.java:46)
	at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:62)
java.net.URISyntaxException: Illegal character in path at index 21: https://api.bunq.com/{basePath}
	at java.net.URI$Parser.fail(URI.java:2848)
	at java.net.URI$Parser.checkChars(URI.java:3021)
	at java.net.URI$Parser.parseHierarchical(URI.java:3105)
	at java.net.URI$Parser.parse(URI.java:3053)
	at java.net.URI.<init>(URI.java:588)
	at io.swagger.v3.parser.util.OpenAPIDeserializer.getServer(OpenAPIDeserializer.java:397)
	at io.swagger.v3.parser.util.OpenAPIDeserializer.getServersList(OpenAPIDeserializer.java:363)
	at io.swagger.v3.parser.util.OpenAPIDeserializer.parseRoot(OpenAPIDeserializer.java:157)
	at io.swagger.v3.parser.util.OpenAPIDeserializer.deserialize(OpenAPIDeserializer.java:111)
	at io.swagger.v3.parser.OpenAPIV3Parser.readWithInfo(OpenAPIV3Parser.java:104)
	at io.swagger.v3.parser.OpenAPIV3Parser.readWithInfo(OpenAPIV3Parser.java:142)
	at io.swagger.v3.parser.OpenAPIV3Parser.readLocation(OpenAPIV3Parser.java:45)
	at io.swagger.parser.OpenAPIParser.readLocation(OpenAPIParser.java:19)
	at org.openapitools.codegen.cmd.Validate.run(Validate.java:46)
	at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:62)
Errors:
	-attribute components.schemas.NoteAttachmentIdealMerchantTransaction_5be1e76160c9d.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentPayment_5be1e76173c42.properties is not of type `object`
	-attribute components.schemas.DraftShareInviteApiKeyQrCodeContent_5be1e75ebc5ad.properties is not of type `object`
	-attribute components.schemas.TabQrCodeContent_5be1e765a27f4.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentPaymentBatch_5be1e7616bfd1.properties is not of type `object`
	-attribute components.schemas.TabUsageSingle_5be1e765ac20a.properties is not of type `object`
	-attribute components.schemas.NoteTextSofortMerchantTransaction_5be1e7618aa66.properties is not of type `object`
	-attribute components.schemas.AttachmentTab.properties is not of type `object`
	-attribute components.schemas.TabUsageMultiple_5be1e765a522c.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentScheduleInstance_5be1e761841b9.properties is not of type `object`
	-attribute components.schemas.NoteTextWhitelistResult_5be1e7618e74b.properties is not of type `object`
	-attribute components.schemas.NoteTextMasterCardAction_5be1e7616a142.properties is not of type `object`
	-attribute components.schemas.NoteTextIdealMerchantTransaction_5be1e7616501a.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentBunqMeFundraiserResult_5be1e76159505.properties is not of type `object`
	-attribute components.schemas.AttachmentPublicContent_5be1e75e5b254.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentRequestInquiryBatch_5be1e76177e58.properties is not of type `object`
	-attribute components.schemas.ScheduleUser_5be1e765663e0.properties is not of type `object`
	-attribute components.schemas.AttachmentConversationContent_5be1e75e5a571.properties is not of type `object`
	-attribute components.schemas.NoteTextRequestResponse_5be1e761824fb.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentBankSwitchServiceNetherlandsIncomingPayment_5be1e76154f08.properties is not of type `object`
	-attribute components.schemas.Session_5be1e7657b84d.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentMasterCardAction_5be1e7616704c.properties is not of type `object`
	-attribute components.schemas.TabItemShop_5be1e7657fc43.properties is not of type `object`
	-attribute components.schemas.NoteTextDraftPayment_5be1e7615f12c.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentWhitelistResult_5be1e7618c958.properties is not of type `object`
	-attribute components.schemas.ExportAnnualOverview_5be1e76103da1.properties is not of type `object`
	-attribute components.schemas.DraftShareInviteBankQrCodeContent_5be1e75ebf101.properties is not of type `object`
	-attribute components.schemas.SchedulePaymentBatch_5be1e7652e387.properties is not of type `object`
	-attribute components.schemas.CertificatePinned_5be1e75e979d5.properties is not of type `object`
	-attribute components.schemas.SandboxUser.properties is not of type `object`
	-attribute components.schemas.SchedulePayment_5be1e76537a3a.properties is not of type `object`
	-attribute components.schemas.AttachmentTabContent_5be1e75e5bb2d.properties is not of type `object`
	-attribute components.schemas.ExportAnnualOverviewContent_5be1e761027be.properties is not of type `object`
	-attribute components.schemas.NoteTextRequestInquiryBatch_5be1e7617a11c.properties is not of type `object`
	-attribute components.schemas.CustomerStatementExportContent_5be1e761051d6.properties is not of type `object`
	-attribute components.schemas.AttachmentPublic.properties is not of type `object`
	-attribute components.schemas.NoteTextScheduleInstance_5be1e76186266.properties is not of type `object`
	-attribute components.schemas.Whitelist_5be1e75f4f26d.properties is not of type `object`
	-attribute components.schemas.CashRegisterQrCodeContent_5be1e75e85b04.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentRequestResponse_5be1e7618030d.properties is not of type `object`
	-attribute components.schemas.NoteTextPayment_5be1e76175f59.properties is not of type `object`
	-attribute components.schemas.TabAttachmentTabContent_5be1e75e5c5bf.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentRequestInquiry_5be1e7617bdb3.properties is not of type `object`
	-attribute components.schemas.NoteTextPaymentBatch_5be1e76171b90.properties is not of type `object`
	-attribute components.schemas.AttachmentMonetaryAccount.properties is not of type `object`
	-attribute components.schemas.CustomerStatementExport_5be1e761085da.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentSofortMerchantTransaction_5be1e76188575.properties is not of type `object`
	-attribute components.schemas.NoteTextRequestInquiry_5be1e7617dea5.properties is not of type `object`
	-attribute components.schemas.ShareInviteBankAmountUsed_5be1e7610d237.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentDraftPayment_5be1e7615cd09.properties is not of type `object`
	-attribute components.schemas.NoteTextBankSwitchServiceNetherlandsIncomingPayment_5be1e7615755e.properties is not of type `object`
	-attribute components.schemas.NoteTextBunqMeFundraiserResult_5be1e7615b22c.properties is not of type `object`

[error] Spec has 52 errors.
@OGKevin
Copy link
Contributor

OGKevin commented Nov 10, 2018

How are the bunq sdks (python, php, csharp) generated? Are they also using the openapi generator?

No, this is done via an internal generator that also happens to generate the Swagger.json

The swagger.json that bunq provides is to new to be generated with that tool. I recall there is an issue for this in their repo. bunq is using openApi3 which is not supported by that too yet.

Reference: swagger-api/swagger-codegen#6598

However, I'm not sure openapi-generator-cli.jar uses swagger-codegen. It could be that {basePath} in the URL is illegal according to the open API 3 spec but I'm not sure if that's the case.

@vplme
Copy link
Author

vplme commented Nov 10, 2018

Ah ok interesting. So the swagger file is mostly for ReDoc?

It seems like OpenAPI v3 should be good with {parameters} in the url. (https://swagger.io/docs/specification/describing-parameters/)

The server objects also allows for parameters (https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#server-object)

It seems that https://github.com/openapitools/openapi-generator is a fork of swagger-codegen.

Running the command locally on the same file does not return the URL errors. Only the other errors. So that is very strange..

wget https://raw.githubusercontent.com/bunq/doc/master/swagger.json
java -jar openapi-generator-cli.jar generate -i swagger.json -g go -o ./bunq &> local_output.txt
Exception in thread "main" org.openapitools.codegen.SpecValidationException: There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI).
 | Error count: 52, Warning count: 2
Errors: 
	-attribute components.schemas.NoteAttachmentIdealMerchantTransaction_5be1e76160c9d.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentPayment_5be1e76173c42.properties is not of type `object`
	-attribute components.schemas.DraftShareInviteApiKeyQrCodeContent_5be1e75ebc5ad.properties is not of type `object`
	-attribute components.schemas.TabQrCodeContent_5be1e765a27f4.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentPaymentBatch_5be1e7616bfd1.properties is not of type `object`
	-attribute components.schemas.TabUsageSingle_5be1e765ac20a.properties is not of type `object`
	-attribute components.schemas.NoteTextSofortMerchantTransaction_5be1e7618aa66.properties is not of type `object`
	-attribute components.schemas.AttachmentTab.properties is not of type `object`
	-attribute components.schemas.TabUsageMultiple_5be1e765a522c.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentScheduleInstance_5be1e761841b9.properties is not of type `object`
	-attribute components.schemas.NoteTextWhitelistResult_5be1e7618e74b.properties is not of type `object`
	-attribute components.schemas.NoteTextMasterCardAction_5be1e7616a142.properties is not of type `object`
	-attribute components.schemas.NoteTextIdealMerchantTransaction_5be1e7616501a.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentBunqMeFundraiserResult_5be1e76159505.properties is not of type `object`
	-attribute components.schemas.AttachmentPublicContent_5be1e75e5b254.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentRequestInquiryBatch_5be1e76177e58.properties is not of type `object`
	-attribute components.schemas.ScheduleUser_5be1e765663e0.properties is not of type `object`
	-attribute components.schemas.AttachmentConversationContent_5be1e75e5a571.properties is not of type `object`
	-attribute components.schemas.NoteTextRequestResponse_5be1e761824fb.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentBankSwitchServiceNetherlandsIncomingPayment_5be1e76154f08.properties is not of type `object`
	-attribute components.schemas.Session_5be1e7657b84d.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentMasterCardAction_5be1e7616704c.properties is not of type `object`
	-attribute components.schemas.TabItemShop_5be1e7657fc43.properties is not of type `object`
	-attribute components.schemas.NoteTextDraftPayment_5be1e7615f12c.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentWhitelistResult_5be1e7618c958.properties is not of type `object`
	-attribute components.schemas.ExportAnnualOverview_5be1e76103da1.properties is not of type `object`
	-attribute components.schemas.DraftShareInviteBankQrCodeContent_5be1e75ebf101.properties is not of type `object`
	-attribute components.schemas.SchedulePaymentBatch_5be1e7652e387.properties is not of type `object`
	-attribute components.schemas.CertificatePinned_5be1e75e979d5.properties is not of type `object`
	-attribute components.schemas.SandboxUser.properties is not of type `object`
	-attribute components.schemas.SchedulePayment_5be1e76537a3a.properties is not of type `object`
	-attribute components.schemas.AttachmentTabContent_5be1e75e5bb2d.properties is not of type `object`
	-attribute components.schemas.ExportAnnualOverviewContent_5be1e761027be.properties is not of type `object`
	-attribute components.schemas.NoteTextRequestInquiryBatch_5be1e7617a11c.properties is not of type `object`
	-attribute components.schemas.CustomerStatementExportContent_5be1e761051d6.properties is not of type `object`
	-attribute components.schemas.AttachmentPublic.properties is not of type `object`
	-attribute components.schemas.NoteTextScheduleInstance_5be1e76186266.properties is not of type `object`
	-attribute components.schemas.Whitelist_5be1e75f4f26d.properties is not of type `object`
	-attribute components.schemas.CashRegisterQrCodeContent_5be1e75e85b04.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentRequestResponse_5be1e7618030d.properties is not of type `object`
	-attribute components.schemas.NoteTextPayment_5be1e76175f59.properties is not of type `object`
	-attribute components.schemas.TabAttachmentTabContent_5be1e75e5c5bf.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentRequestInquiry_5be1e7617bdb3.properties is not of type `object`
	-attribute components.schemas.NoteTextPaymentBatch_5be1e76171b90.properties is not of type `object`
	-attribute components.schemas.AttachmentMonetaryAccount.properties is not of type `object`
	-attribute components.schemas.CustomerStatementExport_5be1e761085da.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentSofortMerchantTransaction_5be1e76188575.properties is not of type `object`
	-attribute components.schemas.NoteTextRequestInquiry_5be1e7617dea5.properties is not of type `object`
	-attribute components.schemas.ShareInviteBankAmountUsed_5be1e7610d237.properties is not of type `object`
	-attribute components.schemas.NoteAttachmentDraftPayment_5be1e7615cd09.properties is not of type `object`
	-attribute components.schemas.NoteTextBankSwitchServiceNetherlandsIncomingPayment_5be1e7615755e.properties is not of type `object`
	-attribute components.schemas.NoteTextBunqMeFundraiserResult_5be1e7615b22c.properties is not of type `object`
Warnings: 
	-Unused model: Avatar_5be1e75e3de25
	-Unused model: Tab_5be1e75f49f9e

	at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:569)
	at org.openapitools.codegen.cmd.Generate.run(Generate.java:348)
	at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:62)

The remaining issues seem to be related to the properties being an array. Which should be an object:

Current

       "NoteAttachmentIdealMerchantTransaction_5be1e76160c9d": {                                                                                                                    
          "type": "object",                                                                                                                                                          
          "properties": [],                                                                                                                                                          
          "required": []                                                                                                                                                             
        },                                         

Properties should be an object:

       "NoteAttachmentIdealMerchantTransaction_5be1e76160c9d": {                                                                                                                    
          "type": "object",                                                                                                                                                          
          "properties": {},                                                                                                                                                          
          "required": []                                                                                                                                                             
        },                                         

@OGKevin
Copy link
Contributor

OGKevin commented Nov 10, 2018

Ah ok interesting. So the swagger file is mostly for ReDoc?

No, ReDoc is not being used anymore. The "official" swagger viewer is being used now. #56

You're indeed correct about the properties. They should be an object not array, that's indeed a bug in the generator.

@kojoru
Copy link
Contributor

kojoru commented Dec 13, 2018

Hi @vverst! Just a small heads up that we're actively working on improving OpenAPI file generation so that it's actually compliant with the spec.

However do note that it may take some time, as we're solving some structural internal problems in the meantime. Also, SDK generated that way might not be the best result anyway, and hand-crafted approach similar to https://github.com/bunqCommunity/bunqJSClient might be better.

kojoru added a commit that referenced this issue Dec 14, 2018
…inition

Remove unneeded header definitions to satisfy the spec. (#82)
@lexym lexym assigned lexym and unassigned kojoru Sep 4, 2020
@lexym lexym closed this as completed Sep 4, 2020
@lexym lexym removed their assignment Sep 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants