Code Monkey home page Code Monkey logo

Comments (14)

mohsen1 avatar mohsen1 commented on May 10, 2024

@fehguy This is great! I'm not sure if I can upload HTML5 file blobs via AJAX calls. But if that's possible, then we can have a button that uploads the JSON and downloads the zip file with a click of the button.

I'll be looking into this. Please keep us updated if anything changed on your side.

from swagger-editor.

fehguy avatar fehguy commented on May 10, 2024

HI @mohsen1 luckily it's not a blob upload--it's pure JSON. You can use the swagger-js client if you like, although it's probably easier to just use the ajax support with angular.

The payload for the post requests is just JSON data.

from swagger-editor.

mohsen1 avatar mohsen1 commented on May 10, 2024

@fehguy That's right. I saw curl and I thought it needs to be an actual file! I'll be experimenting with this asap

from swagger-editor.

fehguy avatar fehguy commented on May 10, 2024

great--yes, i did that to keep it manageable on the CLI.

from swagger-editor.

mohsen1 avatar mohsen1 commented on May 10, 2024

@fehguy Almost there. We only need CORS support on your end. To try it out, checkout deploy-wip branch and run it.

from swagger-editor.

fehguy avatar fehguy commented on May 10, 2024

what endpoint are you hitting? I see it open to all:

curl -i http://generator.wordnik.com/online/api/gen/clients
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, DELETE, PUT
Access-Control-Allow-Headers: Content-Type
Content-Type: application/json
Content-Length: 38
Server: Jetty(9.1.3.v20140225)

["android","java","php","objc","docs"]

I'll try that branch

from swagger-editor.

mohsen1 avatar mohsen1 commented on May 10, 2024

I'm using 'http://generator.helloreverb.com/online/api/gen/client/'

Please see here

from swagger-editor.

fehguy avatar fehguy commented on May 10, 2024

When I run it, it's sending as a GET:

image

also the path should be as such:

http://generator.wordnik.com/online/api/gen/clients/{language} for clients

and

http://generator.wordnik.com/online/api/gen/servers/{framework} for servers

i think this changed from my initial deployment

from swagger-editor.

fehguy avatar fehguy commented on May 10, 2024

Also note that you can get a list of all the clients supported by calling this endpoint:

http://generator.wordnik.com/online/api/gen/clients

or

http://generator.wordnik.com/online/api/gen/servers

which will be handy for populating your drop-down.

from swagger-editor.

mohsen1 avatar mohsen1 commented on May 10, 2024

@fehguy

Please see latest deploy-wip branch. I've updated it per your directions. I'm still getting CORS error

from swagger-editor.

fehguy avatar fehguy commented on May 10, 2024

Hi, it's still appending the JSON body to the query string. The error you're getting is because the URL is > 4096 bytes.

image

from swagger-editor.

mohsen1 avatar mohsen1 commented on May 10, 2024

@fehguy for some reason I thought jQuery's setting for method is actually method. It's type!

83334e0 fixes it.

Now we are getting 500.

It's either the YAML file or backend has some errors.

from swagger-editor.

fehguy avatar fehguy commented on May 10, 2024

great checking

from swagger-editor.

mohsen1 avatar mohsen1 commented on May 10, 2024

@fehguy It's now in gh-pages. I had to write this hacky code to make it work:

92705f1

I need to get those properties from specs itself. Please guide me how can I do that?

This is going to be first Transform Filter we add to project. A Transform Filter is simply modifies the YAML generated JSON to JSON that Swagger apps accept. That way we can keep YAML clean yet having functional JSON output.

from swagger-editor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.