@e22m4u/js-openapi 0.0.6 → 0.0.7
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/dist/cjs/index.cjs
CHANGED
|
@@ -148,6 +148,7 @@ var OAMediaType = {
|
|
|
148
148
|
TEXT_HTML: "text/html",
|
|
149
149
|
APPLICATION_XML: "application/xml",
|
|
150
150
|
APPLICATION_JSON: "application/json",
|
|
151
|
+
APPLICATION_OCTET_STREAM: "application/octet-stream",
|
|
151
152
|
MULTIPART_FORM_DATA: "multipart/form-data"
|
|
152
153
|
};
|
|
153
154
|
var OASecuritySchemeType = {
|
|
@@ -2228,7 +2229,7 @@ var OADocumentBuilder = class extends import_js_service.Service {
|
|
|
2228
2229
|
}
|
|
2229
2230
|
validateOADocumentObject(operationDef.operation, {
|
|
2230
2231
|
schemaUri: "#/$defs/operation",
|
|
2231
|
-
dataSourceUri:
|
|
2232
|
+
dataSourceUri: `#/paths/${escapeJsonPointer(operationDef.path)}/${escapeJsonPointer(operationDef.method)}`
|
|
2232
2233
|
});
|
|
2233
2234
|
}
|
|
2234
2235
|
const operation = operationDef.operation ? structuredClone(operationDef.operation) : {};
|
package/package.json
CHANGED
|
@@ -467,7 +467,7 @@ export class OADocumentBuilder extends Service {
|
|
|
467
467
|
// validation
|
|
468
468
|
validateOADocumentObject(operationDef.operation, {
|
|
469
469
|
schemaUri: '#/$defs/operation',
|
|
470
|
-
dataSourceUri:
|
|
470
|
+
dataSourceUri: `#/paths/${escapeJsonPointer(operationDef.path)}/${escapeJsonPointer(operationDef.method)}`,
|
|
471
471
|
});
|
|
472
472
|
}
|
|
473
473
|
// создание поверхностной копии определения
|
|
@@ -1282,7 +1282,10 @@ describe('OADocumentBuilder', function () {
|
|
|
1282
1282
|
operation: {parameters: 123},
|
|
1283
1283
|
});
|
|
1284
1284
|
};
|
|
1285
|
-
expect(throwable).to.throw(
|
|
1285
|
+
expect(throwable).to.throw(
|
|
1286
|
+
OADocumentObjectValidationError,
|
|
1287
|
+
'Value at "#/paths/~1/get/parameters" must be array.',
|
|
1288
|
+
);
|
|
1286
1289
|
});
|
|
1287
1290
|
|
|
1288
1291
|
it('should define the operation object', function () {
|
|
@@ -421,6 +421,7 @@ export declare const OAMediaType: {
|
|
|
421
421
|
TEXT_HTML: 'text/html';
|
|
422
422
|
APPLICATION_XML: 'application/xml';
|
|
423
423
|
APPLICATION_JSON: 'application/json';
|
|
424
|
+
APPLICATION_OCTET_STREAM: 'application/octet-stream';
|
|
424
425
|
MULTIPART_FORM_DATA: 'multipart/form-data';
|
|
425
426
|
};
|
|
426
427
|
|
package/src/oa-specification.js
CHANGED
|
@@ -106,6 +106,7 @@ export const OAMediaType = {
|
|
|
106
106
|
TEXT_HTML: 'text/html',
|
|
107
107
|
APPLICATION_XML: 'application/xml',
|
|
108
108
|
APPLICATION_JSON: 'application/json',
|
|
109
|
+
APPLICATION_OCTET_STREAM: 'application/octet-stream',
|
|
109
110
|
MULTIPART_FORM_DATA: 'multipart/form-data',
|
|
110
111
|
};
|
|
111
112
|
|