Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Joshua Barnett
    @joshua-barnett
    image.png
    Even though when the request is sent from Dredd it has a body.
    image.png
    Is there a way to modify the FormData sent in these requests via hooks?
    Honza Javorek
    @honzajavorek

    @synthecypher hmmm... I think "file" is still to be correctly supported in the Swagger adapter - apiaryio/fury-adapter-swagger#146

    Regarding the example value used by Dredd, you should be able to specify it by the schema.example property: parameters / in: "body" / schema / example

    sarahasg
    @sarahasg
    image.png
    hello guys, I am trying to do a npm install -g dredd but I am getting this error
    I have no problems installing anything else with npm
    only dredd
    does anyone have any suggestions how to resolve this?
    Honza Javorek
    @honzajavorek
    @sarahasg hi, are you behind a corporate proxy or something like that?
    I'm sorry for not replying earlier, I had rather long vacation.
    Andrew Zakordonets
    @azakordonets
    Hello everyone. Did anyone manage to make Dredd use values specified in swagger deginition object example field ? I described definition object - for each field i have specified example value, and in Swagger UI i can actually see my example, but when i run dredd test - it generates it's own values and doesn't take values from example
    Andrew Zakordonets
    @azakordonets
    Another problem i'm facing is that transaction object for me is always empty..
    hooks.before('/dev/lead > Creates a new Bla > 200 > application/json', transaction => {
        hooks.log('------------------------YAY------------------------')
        var requestBody = JSON.parse(transaction.request.body)
        hooks.log('Before lead Transaction request is ', JSON.stringify(requestBody, null, 2))
        hooks.log('Before lead Transaction request is ', transaction)
        hooks.log('Before lead Transaction request is ', transaction.fullPath)
    })
    Gives this
    hook: ------------------------YAY------------------------
    hook: Before lead Transaction request is
    hook: Before lead Transaction request is
    hook: Before lead Transaction request is
    Andrew Zakordonets
    @azakordonets
    if i use console.log(transaction) then i can see details
    really confusing
    Chilaka Ramakrishna
    @rkchilaka
    Hi
    is this chat active?
    Andrew Zakordonets
    @azakordonets
    doesn't look like..
    Chilaka Ramakrishna
    @rkchilaka
    ha ha
    hi andrew
    i have a small doubts
    doubt*
    please try to answer
    swagger-api/swagger-editor#1795
    i have a base object and it has some required properties
    i want to use the same object with some additional properties but in the new object, there shouldn't be any required attributes
    Andrew Zakordonets
    @azakordonets
    For me it looks like it should not be possible, but i'm not an expert in this matter :)
    Nikita Kunets
    @dkder3k
    Hi everyone)
    @thesageinpilani as I understand as far as it is just yaml and dredd is just a thing that parse this yaml there is no any inheritance
    Chilaka Ramakrishna
    @rkchilaka
    thanks @azakordonets @dkder3k
    i have another doubt, i am new to dredd contract testing
    do i have to write functions for every possible response status code?
    is there any way where i would write only one function for testing one API
    Chilaka Ramakrishna
    @rkchilaka
    i cannot show you guys code that is written by some other guys
    but this guy is calling a single function and building json object which has expected key, like it does show during dredd
    and hitting a mock server
    and writing promise on that
    any idea
    Nikita Kunets
    @dkder3k
    Hmm, at the moment I have no any idea, sry. But some time later I will investigate this question
    Chilaka Ramakrishna
    @rkchilaka
    can i show you the code?
    may be you will understand ?
    const pcsNotFoundExpectation = (xZoozRequestId, fundTargetId) => {
    return {
    method: 'GET',
    statusCode: 404,
    statusMessage: 'Not found',
    'x-zooz-request-id': xZoozRequestId,
    requestBody: {},
    path: /v1/configurations/${fundTargetId},
    expectedBody: {
    code: 40000,
    message: 'Error',
    description: 'fund_target_id does not exist'
    },
    unlimited: true
    };
    };
    const createExpectationForPCS = async (xZoozRequestId, fundTargetId, statusCode, merchantCode) => {
    let data;
    switch (statusCode) {
    case 404:
    data = pcsNotFoundExpectation(xZoozRequestId, fundTargetId);
    break;
    case 500:
    data = pcsInternalServerErrorExpectation(xZoozRequestId, fundTargetId);
    break;
    default:
    data = pcsOptimisticExpectation(xZoozRequestId, fundTargetId, merchantCode);
    break;
    }
    await axios.post('http://new-mock-server.provider-configurations.dcos.dev-fra-apps.zooz.co/expectation', data);
    };
    switch (transaction.name) {
    case 'authorization > /v3/payments/{payment_id}/authorizations > authorize request > 201 > application/json; charset=utf-8': {
    transaction.skip = false;
    const request = requestBuilder.buildAuthorization(JSON.parse(transaction.request.body), transaction.request.headers);
    return expectationBuilder.createExpectationForPCS(request.headers['X-Zooz-Request-Id'], request.body.fund_target_id, 200)
    .then(() => {
    transaction.request.body = JSON.stringify(request.body);
    transaction.request.headers['X-Zooz-Request-Id'] = request.headers['X-Zooz-Request-Id'];
    transaction.request.headers['Zooz-Mock-PaymentsStorage'] = 'state-payment_initial';
    done();
    });
    }
    Chilaka Ramakrishna
    @rkchilaka
    Hi