Coder Social home page Coder Social logo

Comments (5)

aress31 avatar aress31 commented on September 28, 2024 1

@eoftedal that is a fair request, I will add it to the to do list.

Thanks,
Alex

from openapi-parser.

aress31 avatar aress31 commented on September 28, 2024 1

@eoftedal I rewrote swurg from scratch - the version 2.0 is out.

In this version, I use the official Swagger Parser Java library rather than my own implementation. I also use the IExtenderHelpers interface provided by the Burp Suite APIs to build the requests to send to the Active Scanner, Intruder and Repeater.

At the moment, the Burp Suite APIs does not enable adding in body JSON and XML parameters - read the following:

    /**
     * This method adds a new parameter to an HTTP request, and if appropriate
     * updates the Content-Length header.
     *
     * @param request The request to which the parameter should be added.
     * @param parameter An <code>IParameter</code> object containing details of
     * the parameter to be added. Supported parameter types are:
     * <code>PARAM_URL</code>, <code>PARAM_BODY</code> and
     * <code>PARAM_COOKIE</code>.
     * @return A new HTTP request with the new parameter added.
     */
    byte[] addParameter(byte[] request, IParameter parameter);

I added a post to the Burp Suite APIs repository asking whether they are planning to correct this. I am now waiting for an answer from them.

Best regards,
Alex

from openapi-parser.

aress31 avatar aress31 commented on September 28, 2024

@eoftedal, thanks for the feedback.

This behavior is expected, as you can see in the JSON swagger file at http://petstore.swagger.io/v2/swagger.json the pet endpoint produces and consumes data of type application/json, application/xml. Consequently, a work around for your use case would be to manually edit the Swagger file and replace application/json, application/xml with application/x-www-form-urlencoded if what you want is to change the Accept and Content-Type headers.

See the following screenshot.
image

Hope my answer will help you.

from openapi-parser.

eoftedal avatar eoftedal commented on September 28, 2024

If the endpoint consumes application/xml and application/json, why does swurg create a request of type application/x-www-form-urlencoded ?
I would like swurg to put JSON in the body, not application/x-www-form-urlencoded when the content-type from swagger clearly says application/json. Is it because of the duplicate content-types ?

from openapi-parser.

aress31 avatar aress31 commented on September 28, 2024

044ac74

from openapi-parser.

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.