swagger-editor icon indicating copy to clipboard operation
swagger-editor copied to clipboard

Swagger Editor throwing 500 for client generation

Open gargi-v opened this issue 5 years ago • 6 comments

  • OS: Windows
  • Browser: Chrome
  • Method of installation: npm as well as browser version https://editor.swagger.io/

Swagger Editor throws 500 for client generation for custom yamls as well as their own default Petstore yaml

YAML I used :

  1. Petsore Yaml
  2. swagger: '2.0' info: title: windchill-parts-sysapi description: This API will expose the functionality to pull the parts information from Windchill version: v1 host: blahblah.com basePath: /blah schemes:
  • https x-amf-baseUriParameters: loadbalancer: enum:
    • api paths: /change: post: parameters:
      • x-amf-mediaType: application/json in: body name: generated schema: example: changeDetails: common: messageID: '1234567890' targetSystem: EBUPLM_NOUNNAME startDateTimeInMS: '1546281000000' responses: '200': description: Success x-amf-mediaType: application/json schema: example: changeDetailsResponse: nounNames: - itemName: 'ARRANGEMENT,EXHAUST GAS RECIRCULATION' imsName: 'ARRANGEMENT,EXH GAS RCN' shortName: 'ARG,RCN' status: A statusCode: 'N' allowableIDType: '27' objectNumber: '0000000463' modifier1: ARRANGEMENT modifier2: EXHAUST modifier3: GAS modifier4: RECIRCULATION modifier5: '' sourceControlledIDType: '' eswItemName: 'No' safetyParts: 'No' - itemName: ACCUMULATOR imsName: ACCUMULATOR shortName: ACM status: A statusCode: R allowableIDType: '10,17,15,16,11' objectNumber: '0000000500' modifier1: ACCUMULATOR modifier2: '' modifier3: '' modifier4: '' modifier5: '' sourceControlledIDType: '15-1,17' eswItemName: 'No' safetyParts: 'No' - itemName: 'CALIBRATION,ELECTRONIC ENGINEERING' imsName: 'CALIBRATION,ETR EGR' shortName: 'CAL,EGR' status: I statusCode: 'N' allowableIDType: '17' objectNumber: '0000001171' modifier1: CALIBRATION modifier2: ELECTRONIC modifier3: ENGINEERING modifier4: '' modifier5: '' sourceControlledIDType: '' eswItemName: 'No' safetyParts: 'No' status: success message: The data has been fetched successfully nounNameCount: 3 /heartbeat: get: responses: '200': description: '' x-amf-mediaType: application/json schema: example: applicationName: some-application region: DEV status: RUNNING

On Swagger Editor, I see 500 in the networks tab, although a zip file is downloaded, it is empty

Steps to reproduce the behavior:

  1. Go to 'https://editor.swagger.io/'
  2. Click on '.Generate Client -> csharp OR java'
  3. See Networks tab -> 500, Try to open downloaded zip -> Says it is not a valid zip

Expected a zip with client code in selected language to be downloaded

Check out the screenshot- swagger-err2

It was working perfectly fine about 15 days ago..Any thoughts about what can be done to fix this? All help appreciated, Thanks in advance!

gargi-v avatar Jun 14 '21 14:06 gargi-v

Same problem generating servers too not only clients. I would say was working perfectly 1 or 2 weeks ago.

AbelRuol avatar Jun 15 '21 12:06 AbelRuol

Same for me. Not failing on all inputs - a simple one from an asp.net boilerplate site is fine, but an older .net server is now failing.

stephenhynds avatar Jun 16 '21 10:06 stephenhynds

We have the same problem since yesterday. From what I have reviewed, the problem seems that when you want to download the file with the generated code from the client it gives an error, but the download URL to that file is correct. Also, if you take that URL and access it from the browser, it will download correctly. Could the problem be in the way of downloading the file?

From what I have been reviewing, this project uses a dependency that is react-file-download to download the file, and apparently on its official page they comment that the package is deprecated. I imagine hopefully updating the dependency will fix the problem.

ribonuclecode avatar Jun 17 '21 11:06 ribonuclecode

We have the same problem since yesterday. From what I have reviewed, the problem seems that when you want to download the file with the generated code from the client it gives an error, but the download URL to that file is correct. Also, if you take that URL and access it from the browser, it will download correctly. Could the problem be in the way of downloading the file?

From what I have been reviewing, this project uses a dependency that is react-file-download to download the file, and apparently on its official page they comment that the package is deprecated. I imagine hopefully updating the dependency will fix the problem.

+1

andy380743909 avatar Jun 19 '21 14:06 andy380743909

@andy380743909 Thanks for providing troubleshooting details. Now I am able to reproduce. It appears to be an OpenAPI 2.x generator issue.

related #2674.

tim-lai avatar Jun 21 '21 18:06 tim-lai

Another update... this appears to have been an infrastructure issue, and should now be resolved. I was able to download generated versions for both OpenApi 2.x and 3.0 definitions for both servers and clients. Going to close both #2674 and #2679.

tim-lai avatar Jun 21 '21 20:06 tim-lai