Coder Social home page Coder Social logo

bruno-docs's Issues

Feedback for “Migrating from Postman”

Hello,
I try to migrate my API tests scripts from postman
I have a lot with a test which valid the Json shema of the response.
In Postman I wrote this like that

var schema = 
{json model schema}
;

const response = pm.response.json();
    pm.test('Schema is valid', () => {
        pm.expect(response).to.have.jsonSchema(schema);
    });

and it doesn't work with Bruno

I have seen a solution in https://medium.com/@jagdalebr/brunos-api-adventure-7937abb70d47

const Ajv = require('ajv');
const ajv = new Ajv();
const schema = 
{json model schema}
test("should be able to validate JSON", function() {
  const data = res.getBody();
  const valid = ajv.validate(schema, data);
  expect(res.getStatus()).to.equal(200);
  expect(valid).to.be.true;
  if (!valid) console.log(ajv.errors);
});


Is it possible to intégrate this to the Import from postman tool and the Bruno's translator ?
Thanks

OAUTH setup

Hello,

Today I tested version 1.17.0
At collection level I did the setup of OAUTH Authorization Code Grant Type. Getting an access token works well. At API level I set "Auth" to "Inherit". Then I see message "You need to use scripting to set the access token in the request headers.".
From there I'm stuck. What am I supposed to do?

Regards,

Serge

Feedback for “Bruno CLI”: -f "html"

Hello,

this page says there are 2 options for formatting -f "json" (which is standard) and -f "junit" (btw, maybe you could an example "--output filename.xml -f "junit" to the page)

But what about "html"? I saw some tutorials about it and the Google AI assistant Bard also told me about the "html" option. Is the documentation up-to-date?

  1. Also I have a problem locally and on Jenkins that I have no css formatting.
    -> I found out that it's because it's opened via"file://...bruno_report.html". It needs to be opened with a http server (e.g. via a VS Code Extension Live Server or via Python http.server). Maybe you could add a hint about this.

2.But still I see errors

  1. ...But still I see errors
  • Uncaught SyntaxError: "" literal not terminated before end of script
  • Not supported Hash-Algorithm in "integrity"-Attribute: ""sha384"
  • Error parsing 'integrity' attribute ('"sha384-H1O/HLFeATPh9cI9n3i9GSJxTVTOP/szRYMVW2jNRIM/IWkMLfzlS5xgd+xmyoyN"'). The specified hash algorithm must be one of 'sha256', 'sha384', or 'sha512'.
  • Uncaught SyntaxError: Invalid or unexpected token
  • GET http://localhost:8000/%22scripts.33e4601326058ddc.js/%22 net::ERR_ABORTED 404 (File not found)

Is this an error in the report or on my side? More documentation about this would be helpful.

Thanks.

Best,
Nikita

Feedback for “Bru Tag Reference”

Sending a file through the multipart Form

there's a problem with this feature, it doesn't pass the file through to the api

I have this project i was working on

    @UploadedFile() file: Express.Multer.File,
    // @Res() res: Response,
  ) {
    try {
      if (file) {
        console.log(file);
      } else {
        console.log('Error uploading file');
        console.log(file);


        // throw new Error("File didn't get uploaded");
      }
    } catch (error) {
      console.log(error);

      //   res.status(400).send({ error: error.message });
    }
  }

using nestjs, i tried to send a file using the multipart form, it was just giving errors.

Feedback for “Getting Started with Bruno”

I am wondering how to handle an environment or collection variables in assert. I also cannot seem to get nested variables to work either. CompoundVar does not have the expected value of 123-456

I have the following case and the first assert fails as an assert but passes as a test. I believe it is because the first variable references an environment variable.

vars {
  AuthIdentityId2:   f38536f7-5aa8-e611-9965-f0921cdc2c4d
  AuthIdentityId: {{process.env.QA_AuthIdentityId}}
  BaseVar: 123
  CompoundVar: {{BaseVar}}-456
}

assert {
  res.body.Id: eq {{AuthIdentityId}}
  res.body.Id: eq {{AuthIdentityId2}}
}

test("Validate Data", function() {
    const body = res.getBody();
    expect(body.Id).to.equal(bru.getEnvVar('AuthIdentityId'));
    expect(body.Id).to.equal(bru.getEnvVar('AuthIdentityId2'));
}

Align documentation with proposal in bruno repo

Problem statement

I have several collections that rely on the use of authentication tokens that are specific to each developer and may not be shared or committed to version control.

Proposed solution

Being able to load these tokens from the system environment (process.env) would support my needs for local usage as well as future usage on CI/CD pipeline.

Relates to usebruno/bruno#170

Broken links in “Vars”

The link to "Response" and "Response Query" are broken. I didn't look at other pages in documentation to see if more links are impacted; if the overall structure of documentation changed then it's very possible that more links have been broken.

Vars

Current

The res object is available, allowing you to declaratively parse the response and set variables, instead of writing scripts to do the same.

For parsing the response, you can checkout the response query that allows you to easily query your response.

Intended

The res object is available, allowing you to declaratively parse the response and set variables, instead of writing scripts to do the same.

For parsing the response, you can checkout the response query that allows you to easily query your response.

I get a 404 when clicking the Edit button, so presumably that's either broken or I don't have permission to edit the page.

Feedback for “Secrets Management”

I love this tool, the privacy it provides, and the fact that it is open source, but I would like to have a further idea on how does Bruno manage the secret variables by using the secret checkbox. As far I have seen into the current documentation it says "Bruno will manage your secrets internally and will not write them into the environment file." which is not descriptive at all. Could you please provide more feedback about this matter? Thank you very much.

referencing OAuth token

OAuth authentication is now working in the GUI and I can successfully get an access token. But now I need to use that token in a request and I don't see how to reference it in a script. How do you get the token into the request?

Feedback for Docs

Hi,
Bruno is awesome and much less overwhelming for newcomers. The docs, however, are a little less beginner-friendly. I understand that these are likely written for folks coming from Postman and covers the differences well, but it's lacking (or I can't easily find) basic introduction to the UI and working mechanics of the application.

Ironically, I've had to reference the Postman docs to have a better understand of what Bruno does. For reference, I'm a PM and not a developer. Still, a lot of us have reason to fiddle with APIs and better onboarding would be a big help!

Feedback for “Bruno CLI”

Bruno CLI install has some outdated vulnerable packages, please see the below image for more information. Let me know if this can be corrected.
BrunoCLIWarnings

Have a console like Postman

The last restraint before I migrate from Postman to Bruno is the lack of a real console. I can't work properly with the chrome debuger.
I'd like to have in one time when I send a request :

  • The real request I send
  • The informations of the network
  • The headers sent and recieved
  • The bodies sent and received
  • The errors
    Is it possible to have this ?

Feedback for “JavaScript API Reference”

The documentation for setNextRequest states that it should work in a post-request script or test-script. I have only been able to get it to run in script:post-response {} and in tests {}. for instance the first snippet works but the second one does not. This would not be as big a problem except for the fact that when importing a collection from postman it keeps the setNextRequest in the tests section and it also calls is postman.setNextRequest

script:post-response {
  bru.setNextRequest("TestsVariable 3");
}

tests {
  bru.setNextRequest("TestsVariable 3");
}

Feedback for “Secrets Management”

This page talks about .env files and .bru files for secrets. It seems that Bruno saves the secrets in .bru files only. Where do the .env files come in? Should I create them manually?

I don't understand this and I'm not able to get secrets in .env files to work. I think these instructions could be more prescriptive and tell the user:

  • what files to create manually, if any
  • what format they should be in
  • when the .env files are read by Bruno (do I need to restart the UI?)

Readme missing steps

When someone new to bruno-docs, like me, is trying to run it locally, it does not work following instructions in Readme.

After going through Next.js documentation I figure readme.md is missing steps for installing packages:
Screenshot 2024-07-21 at 13 06 51

Something like this would be handy:
Screenshot 2024-07-21 at 13 05 01

Inbuilt Libraries

Can it be noted on the Inbuilt Libraries page, or somewhere else, that moduleWhitelist must be used in bruno.json (in the project folder) to enable a module to run

{
  "version": "1",
  "name": "bruno-testbench",
  "type": "collection",
  "scripts": {
    "moduleWhitelist": [
      "crypto"
    ],
    "filesystemAccess": {
      "allow": true
    }
  }
}

Feedback for “Sync requests”

Dear Anoop,

I am using Bruno-1.21.0, and I want to use this code to sync requests:

const axios = require("axios");
 
const response = await axios.get("https://api.github.com/users/usebruno");

Unfortunately this is not working :-(
The Response shown is this: Error invoking remote method 'send-http-request': SyntaxError: Unexpected identifier
As far as I can determine this is cause by the await.
If I wrap it in an anonymous function like this:

const axios = require("axios");
 
(async () => {
  const response = await axios.get("https://api.github.com/users/usebruno");
})();

it works (but the calls are asynchronyous, which is not what I wanted)

Kind regards,
Leen Baan

Feedback for “Migrating from Postman”

My coworker and I have noticed more success importing tests and scripts when a collection is exported as 2.1 instead of 2.0. The documentation doesn't note that there should be a difference, but we've found that 2.1 performs better consistently.

Feedback for “DotEnv File”

This page https://docs.usebruno.com/secrets-management/dotenv-file
looks ok but the way it is written, it gives wrong impression that the .env file can be process.env or maybe some other name, like local.env.

There should be a screenshot with code directory (or a visual representation of directory structure), where it is shown:

  • where the file is (in main directory, not subfolder collection),
  • and that the full name of the file has to be .env.

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.