Comments (7)
π
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.
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.
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.
Good catch! :)
from scalar.
@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.
@danp AMAZING work
are we good to close this issue?
from scalar.
π Thanks!
from scalar.
Related Issues (20)
- Operation-scoped server URLs are ignored
- Stripe: all form fields empty (Content-Type: application/x-www-form-urlencoded' )
- CoinMarketCap: URL wrong
- Select which libraries should be used for the example requests HOT 1
- Collapse empty API client cards by default HOT 1
- page title canβt be changed
- Show response schemas next to the response examples
- [DOC-1430] Scalar NestJS Integration with Helmet doesnt work HOT 5
- [DOC-1431] request body doesnt reset on active item change
- [DOC-1432] Persist REST API Client Modal State
- [DOC-1433] Pass in config ignore list for http snippet Client/Languages
- [DOC-1434] Add Fetch to JavaScript http snippets HOT 1
- [DOC-1435] Investigate bundle size on type imports with Bun HOT 2
- [DOC-1436] Support Base Path field for swagger 2.0
- Ctrl K -> select doesn't scroll to appropriate place HOT 3
- Body schema properties description doesnt show as markdown HOT 3
- ElysiaJS Inline Codeblock for description doesn't work for Body in POST. But it works for Query in GET. HOT 5
- Running `parse` from `@scalar/swagger-parser` throws `utils.inherit is not a function` when running in a Vue app. HOT 3
- [DOC-1460] Allow Download of zip response from api client request response
- Read-only properties should not show up in the request examples HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scalar.