Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialize a request into JSON? #4

Closed
banezaklan opened this issue Aug 22, 2019 · 10 comments
Closed

Serialize a request into JSON? #4

banezaklan opened this issue Aug 22, 2019 · 10 comments
Labels
feature New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@banezaklan
Copy link

Hey there, have you already planned for serializing entire request into JSON? I'm looking for a simple way to document a REST API, and make it "interactable" in the same time.
Like postman has these "Collections" but simpler I think...

@AndrewBastin
Copy link
Member

AndrewBastin commented Aug 22, 2019

Hey....

That seems dope, I will work on a PR for that...

But can you clarify what you want ?

Do you want the ability to export the entire request config for a single request or for multiple requests ?

@liyasthomas liyasthomas added feature New feature or request need information Requires more info labels Aug 22, 2019
@brandonros
Copy link

One idea is to store some state in the hash or query string of the URL, which would make sharing a request with other teammates a simple copy + paste away.

@AndrewBastin
Copy link
Member

AndrewBastin commented Aug 28, 2019

@brandonros I like this suggestion, can you open this as a separate issue ?

I will start working on the PR.

@NBTX
Copy link
Contributor

NBTX commented Aug 28, 2019

The problem with that though is that the state would, for some more advanced queries be massive.

@AndrewBastin
Copy link
Member

The problem with that though is that the state would, for some more advanced queries be massive.

We can introduce support for basic queries only (ie method, url, path) for now.

I think that would still be pretty helpful.

We could flush it out as we go...

@liyasthomas
Copy link
Member

liyasthomas commented Aug 28, 2019

Appending on hash or query string of the URL is the easiest way to do this, but in a long run, this would be painful. But as @brandonros said, this could be the easiest way to sahe it to others with copy/paste. #72 does the same approach.

Alternate option is export and import JSON. Which solves the case of complex or large queries but need further dependencies I suppose.

@liyasthomas liyasthomas pinned this issue Aug 28, 2019
@brandonros
Copy link

brandonros commented Aug 28, 2019

We can introduce support for basic queries only (ie method, url, path) for now.

I'd argue for including headers too because of how important they are for authentication and how potentially useless requests are if you can't pass auth headers, etc. :)

I'd imagine you would only start running into grossness when you pass probably, the 16kb - 64kb range? Everything below that is probably fine.

https://postwoman.foo/?state={"model":{ ... }} or hash, if you prefer

@jgroom33
Copy link
Contributor

postman uses the concept of environment to store state. this works ok, but is limited because it is a string by default.
the cache should be a combination of responses, requests, and user defined vars
The UI should present each of these objects.
To reference any of these objects, a templating engine should be implemented. This would allow the following behavior:

  1. define a var of: foo={"model":{"foo":"bar"}}
  2. use var in a request: https://postwoman.foo/?state={{foo}}
  3. use response in subsequent request: https://postwoman.foo/blog/{{request1label.response.items[0].id}}

@liyasthomas liyasthomas added good first issue Good for newcomers hacktoberfest help wanted Extra attention is needed and removed need information Requires more info labels Sep 28, 2019
@TheHollidayInn
Copy link
Contributor

I think that with my new collections PR, I could solve this issue since the requests are stored in vuex now. I could add a copy button to the requests that are saved and allow the user to get the json

@liyasthomas
Copy link
Member

#176 #209 fixes this. Hence closing.

@liyasthomas liyasthomas unpinned this issue Oct 24, 2019
liyasthomas pushed a commit that referenced this issue Feb 15, 2021
AndrewBastin pushed a commit that referenced this issue Apr 11, 2023
feat: added jest and jest-fp-ts setup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

7 participants