Giter VIP home page Giter VIP logo

Comments (7)

danp avatar danp commented on May 13, 2024 2

πŸ‘

Actually, before I open another issue, I also had to add this patch to get the JSON bodies to show:

diff --git a/packages/api-client/src/components/ApiClient/Response/Response.vue b/packages/api-client/src/components/ApiClient/Response/Response.vue
index 712a2c8d..924b8c3b 100644
--- a/packages/api-client/src/components/ApiClient/Response/Response.vue
+++ b/packages/api-client/src/components/ApiClient/Response/Response.vue
@@ -59,6 +59,9 @@ const responseData = computed(() => {
   if (value && isJsonString(value)) {
     return JSON.stringify(JSON.parse(value), null, 2)
   }
+  if (value && !isJsonString(value)) {
+    return JSON.stringify(value, null, 2)
+  }
 
   return value
 })

Perhaps related? Was getting an error in the dev console otherwise.

from scalar.

danp avatar danp commented on May 13, 2024 1

Sure: #331. I included the second diff but I'm guessing it's not right. Feel free to edit/etc or I can remove it if you want.

from scalar.

danp avatar danp commented on May 13, 2024

I was able to get things going (partially, will open another issue) with this:

diff --git a/packages/api-client/src/helpers/sendRequest.ts b/packages/api-client/src/helpers/sendRequest.ts
index 493c25d4..d130a04b 100644
--- a/packages/api-client/src/helpers/sendRequest.ts
+++ b/packages/api-client/src/helpers/sendRequest.ts
@@ -76,7 +76,8 @@ export async function sendRequest(
     await axios(config)
       .then((res) => {
         return {
-          ...res.data,
+          ...(proxyUrl ? res.data : res),
+          ...(!proxyUrl && {statusCode: res.status}),
           error: false,
         }
       })

from scalar.

hanspagel avatar hanspagel commented on May 13, 2024

Good catch! :)

from scalar.

marclave avatar marclave commented on May 13, 2024

@danp wouod you be interested in opening that as a PR; @hanspagel maybe we can also describe the interface for the proxy with inline comments maybe?

from scalar.

marclave avatar marclave commented on May 13, 2024

@danp AMAZING work

are we good to close this issue?

from scalar.

danp avatar danp commented on May 13, 2024

πŸ‘ Thanks!

from scalar.

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.