Skip to content

Commit db947f4

Browse files
authored
Custom upload fixes (#2852)
1 parent ea4d29f commit db947f4

File tree

11 files changed

+26
-11
lines changed

11 files changed

+26
-11
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "openapi-workspaces",
33
"license": "MIT",
44
"private": true,
5-
"version": "0.55.0",
5+
"version": "0.55.1",
66
"workspaces": [
77
"projects/json-pointer-helpers",
88
"projects/openapi-io",

projects/fastify-capture/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@useoptic/fastify-capture",
33
"license": "MIT",
44
"packageManager": "[email protected]",
5-
"version": "0.55.0",
5+
"version": "0.55.1",
66
"main": "build/index.js",
77
"types": "build/index.d.ts",
88
"files": [

projects/json-pointer-helpers/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@useoptic/json-pointer-helpers",
33
"license": "MIT",
44
"packageManager": "[email protected]",
5-
"version": "0.55.0",
5+
"version": "0.55.1",
66
"main": "build/index.js",
77
"types": "build/index.d.ts",
88
"files": [

projects/openapi-io/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@useoptic/openapi-io",
33
"license": "MIT",
44
"packageManager": "[email protected]",
5-
"version": "0.55.0",
5+
"version": "0.55.1",
66
"main": "build/index.js",
77
"types": "build/index.d.ts",
88
"files": [

projects/openapi-utilities/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@useoptic/openapi-utilities",
33
"license": "MIT",
44
"packageManager": "[email protected]",
5-
"version": "0.55.0",
5+
"version": "0.55.1",
66
"main": "build/index.js",
77
"types": "build/index.d.ts",
88
"files": [

projects/optic/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@useoptic/optic",
33
"license": "MIT",
44
"packageManager": "[email protected]",
5-
"version": "0.55.0",
5+
"version": "0.55.1",
66
"main": "build/index.js",
77
"types": "build/index.d.ts",
88
"files": [

projects/optic/src/commands/diff/diff-all.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,11 @@ const getDiffAllAction =
653653
);
654654
process.exitCode = 1;
655655
return;
656-
} else if (options.upload && !config.isAuthenticated) {
656+
} else if (
657+
options.upload &&
658+
!config.isAuthenticated &&
659+
!customOptions.customUpload
660+
) {
657661
logger.error(
658662
chalk.bold.red(
659663
'Error: Must be logged in to upload results. Run optic login to authenticate.'

projects/optic/src/commands/diff/diff.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,11 @@ const getDiffAction =
309309
// For json output we only want to render json
310310
logger.setLevel('silent');
311311
}
312-
if (options.upload && !config.isAuthenticated) {
312+
if (
313+
options.upload &&
314+
!config.isAuthenticated &&
315+
!customOptions.customUpload
316+
) {
313317
logger.error(
314318
chalk.bold.red(
315319
'Error: Must be logged in to upload results. Run optic login to authenticate.'

projects/optic/src/utils/spec-loaders.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,21 @@ export type ParseResult =
5353
| (ParseOpenAPIResult<FlatOpenAPIV2.Document> & {
5454
isEmptySpec: boolean;
5555
from: 'git' | 'file' | 'url' | 'empty' | 'cloud';
56+
fileContext: SpecFromInput;
5657
version: '2.x.x';
5758
context: ParseResultContext;
5859
})
5960
| (ParseOpenAPIResult<FlatOpenAPIV3.Document> & {
6061
isEmptySpec: boolean;
6162
from: 'git' | 'file' | 'url' | 'empty' | 'cloud';
63+
fileContext: SpecFromInput;
6264
version: '3.0.x';
6365
context: ParseResultContext;
6466
})
6567
| (ParseOpenAPIResult<FlatOpenAPIV3_1.Document> & {
6668
isEmptySpec: boolean;
6769
from: 'git' | 'file' | 'url' | 'empty' | 'cloud';
70+
fileContext: SpecFromInput;
6871
version: '3.1.x';
6972
context: ParseResultContext;
7073
});
@@ -209,6 +212,7 @@ async function parseSpecAndDereference(
209212
const sourcemap = createNullSpecSourcemap(spec);
210213
return {
211214
jsonLike: spec,
215+
fileContext: input,
212216
sourcemap,
213217
from: 'empty',
214218
version: '3.0.x',
@@ -225,6 +229,7 @@ async function parseSpecAndDereference(
225229
);
226230
return {
227231
jsonLike,
232+
fileContext: input,
228233
sourcemap,
229234
version: checkOpenAPIVersion(jsonLike),
230235
from: 'cloud',
@@ -255,6 +260,7 @@ async function parseSpecAndDereference(
255260
...parseResult,
256261
version: checkOpenAPIVersion(parseResult.jsonLike),
257262
from: 'git',
263+
fileContext: input,
258264
isEmptySpec: false,
259265
context: {
260266
vcs: 'git',
@@ -273,7 +279,7 @@ async function parseSpecAndDereference(
273279
return {
274280
...parseResult,
275281
version: checkOpenAPIVersion(parseResult.jsonLike),
276-
282+
fileContext: input,
277283
from: 'url',
278284
isEmptySpec: false,
279285
context: null,
@@ -303,6 +309,7 @@ async function parseSpecAndDereference(
303309

304310
return {
305311
...parseResult,
312+
fileContext: input,
306313
version: checkOpenAPIVersion(parseResult.jsonLike),
307314
from: 'file',
308315
isEmptySpec: false,

projects/rulesets-base/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@useoptic/rulesets-base",
33
"license": "MIT",
44
"packageManager": "[email protected]",
5-
"version": "0.55.0",
5+
"version": "0.55.1",
66
"main": "build/index.js",
77
"types": "build/index.d.ts",
88
"files": [

projects/standard-rulesets/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@useoptic/standard-rulesets",
33
"license": "MIT",
44
"packageManager": "[email protected]",
5-
"version": "0.55.0",
5+
"version": "0.55.1",
66
"main": "build/index.js",
77
"types": "build/index.d.ts",
88
"files": [

0 commit comments

Comments
 (0)