@intrig/core 0.0.15-29 → 0.0.15-30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/main.js +11 -8
- package/package.json +1 -1
package/main.js
CHANGED
|
@@ -7840,15 +7840,16 @@ function normalizeResponses(spec) {
|
|
|
7840
7840
|
k,
|
|
7841
7841
|
doDeref(v)
|
|
7842
7842
|
]).filter(([_, v])=>v !== undefined));
|
|
7843
|
-
Object.
|
|
7844
|
-
|
|
7845
|
-
|
|
7843
|
+
Object.entries(operationOb.responses).filter(([_, v])=>Boolean(v)).forEach(([statusCode, response])=>{
|
|
7844
|
+
const responseObj = response;
|
|
7845
|
+
if (responseObj.headers) {
|
|
7846
|
+
responseObj.headers = doDeref(responseObj.headers);
|
|
7846
7847
|
}
|
|
7847
|
-
if (
|
|
7848
|
-
|
|
7848
|
+
if (responseObj.links) {
|
|
7849
|
+
responseObj.links = doDeref(responseObj.links);
|
|
7849
7850
|
}
|
|
7850
|
-
if (
|
|
7851
|
-
Object.values(
|
|
7851
|
+
if (responseObj.content) {
|
|
7852
|
+
Object.values(responseObj.content).forEach((mto)=>{
|
|
7852
7853
|
if (mto.examples) {
|
|
7853
7854
|
mto.examples = Object.fromEntries(Object.entries(mto.examples).map(([k, v])=>[
|
|
7854
7855
|
k,
|
|
@@ -7856,7 +7857,9 @@ function normalizeResponses(spec) {
|
|
|
7856
7857
|
]).filter(([_, v])=>v !== undefined));
|
|
7857
7858
|
}
|
|
7858
7859
|
if (!isRef(mto.schema)) {
|
|
7859
|
-
|
|
7860
|
+
// Include status code in name to differentiate responses
|
|
7861
|
+
const postfix = statusCode.startsWith('2') ? 'ResponseBody' : `ResponseBody${statusCode}`;
|
|
7862
|
+
const paramName = generateTypeName(operationOb, postfix);
|
|
7860
7863
|
draft.components = draft.components ?? {};
|
|
7861
7864
|
draft.components.schemas = draft.components.schemas ?? {};
|
|
7862
7865
|
draft.components.schemas[paramName] = mto.schema;
|