@scalar/oas-utils
Advanced tools
Comparing version 0.2.72 to 0.2.73
# @scalar/oas-utils | ||
## 0.2.73 | ||
### Patch Changes | ||
- 82f7c35: fix: rollback proxy | ||
- 3421489: fix: remove examples from request payload before parsing | ||
## 0.2.72 | ||
@@ -4,0 +11,0 @@ |
/** | ||
* Pass an URL or a relative URL and get an absolute URL | ||
*/ | ||
export declare const makeUrlAbsolute: (url?: string, baseUrl?: string) => string | undefined; | ||
export declare const makeUrlAbsolute: (url?: string) => string | undefined; | ||
//# sourceMappingURL=makeUrlAbsolute.d.ts.map |
/** | ||
* Pass an URL or a relative URL and get an absolute URL | ||
*/ | ||
const makeUrlAbsolute = (url, baseUrl) => { | ||
const makeUrlAbsolute = (url) => { | ||
if (!url || | ||
url.startsWith('http://') || | ||
url.startsWith('https://') || | ||
(typeof window === 'undefined' && !baseUrl)) { | ||
typeof window === 'undefined') | ||
return url; | ||
} | ||
const base = baseUrl || window.location.href; | ||
const baseUrl = window.location.href; | ||
// Remove any query parameters or hash from the base URL | ||
const cleanBaseUrl = base.split('?')[0]?.split('#')[0]; | ||
const cleanBaseUrl = baseUrl.split('?')[0]?.split('#')[0]; | ||
// For base URLs with a path component, we want to remove the last path segment | ||
@@ -15,0 +14,0 @@ // if it doesn't end with a slash |
@@ -216,2 +216,7 @@ import { securitySchemeSchema, authExampleFromSchema } from '../entities/spec/security.js'; | ||
}; | ||
// Remove any examples from the request payload as they conflict with our examples property and are not valid | ||
if (requestPayload.examples) { | ||
console.warn('[@scalar/api-client] operation.examples is not a valid openapi property'); | ||
delete requestPayload.examples; | ||
} | ||
// Add list of UIDs to associate security schemes | ||
@@ -218,0 +223,0 @@ // As per the spec if there is operation level security we ignore the top level requirements |
@@ -19,3 +19,3 @@ { | ||
], | ||
"version": "0.2.72", | ||
"version": "0.2.73", | ||
"engines": { | ||
@@ -111,5 +111,5 @@ "node": ">=18" | ||
"@scalar/object-utils": "1.1.12", | ||
"@scalar/openapi-types": "0.1.5", | ||
"@scalar/themes": "0.9.47", | ||
"@scalar/types": "0.0.19", | ||
"@scalar/openapi-types": "0.1.5" | ||
"@scalar/types": "0.0.19" | ||
}, | ||
@@ -121,4 +121,4 @@ "devDependencies": { | ||
"zod-to-ts": "^1.2.0", | ||
"@scalar/openapi-parser": "0.8.9", | ||
"@scalar/build-tooling": "0.1.12", | ||
"@scalar/openapi-parser": "0.8.9", | ||
"@scalar/openapi-types": "0.1.5" | ||
@@ -125,0 +125,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
385412
8049