Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@api-platform/api-doc-parser

Package Overview
Dependencies
Maintainers
6
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@api-platform/api-doc-parser - npm Package Compare versions

Comparing version 0.16.2 to 0.16.3

lib/openapi3/types.d.ts

3

lib/openapi3/parseOpenApi3Documentation.d.ts
import { Api } from "../Api.js";
import type { OpenAPIV3 } from "openapi-types";
import type { RequestInitExtended } from "./types";
export interface ParsedOpenApi3Documentation {

@@ -8,3 +9,3 @@ api: Api;

}
export default function parseOpenApi3Documentation(entrypointUrl: string): Promise<ParsedOpenApi3Documentation>;
export default function parseOpenApi3Documentation(entrypointUrl: string, options?: RequestInitExtended): Promise<ParsedOpenApi3Documentation>;
//# sourceMappingURL=parseOpenApi3Documentation.d.ts.map
import { Api } from "../Api.js";
import handleJson, { removeTrailingSlash } from "./handleJson.js";
export default function parseOpenApi3Documentation(entrypointUrl) {
export default function parseOpenApi3Documentation(entrypointUrl, options = {}) {
entrypointUrl = removeTrailingSlash(entrypointUrl);
return fetch(entrypointUrl)
let headers = typeof options.headers === "function" ? options.headers() : options.headers;
headers = new Headers(headers);
headers.append("Accept", "application/vnd.openapi+json");
return fetch(entrypointUrl, Object.assign(Object.assign({}, options), { headers: headers }))
.then((res) => Promise.all([res, res.json()]))

@@ -7,0 +10,0 @@ .then(([res, response]) => {

{
"name": "@api-platform/api-doc-parser",
"version": "0.16.2",
"version": "0.16.3",
"description": "Transform an API documentation (Hydra, OpenAPI, GraphQL) in an intermediate representation that can be used for various tasks such as creating smart API clients, scaffolding code or building administration interfaces.",

@@ -5,0 +5,0 @@ "files": [

import { Api } from "../Api.js";
import handleJson, { removeTrailingSlash } from "./handleJson.js";
import type { OpenAPIV3 } from "openapi-types";
import type { RequestInitExtended } from "./types";

@@ -12,6 +13,12 @@ export interface ParsedOpenApi3Documentation {

export default function parseOpenApi3Documentation(
entrypointUrl: string
entrypointUrl: string,
options: RequestInitExtended = {}
): Promise<ParsedOpenApi3Documentation> {
entrypointUrl = removeTrailingSlash(entrypointUrl);
return fetch(entrypointUrl)
let headers: HeadersInit | undefined =
typeof options.headers === "function" ? options.headers() : options.headers;
headers = new Headers(headers);
headers.append("Accept", "application/vnd.openapi+json");
return fetch(entrypointUrl, { ...options, headers: headers })
.then((res) => Promise.all([res, res.json()]))

@@ -18,0 +25,0 @@ .then(

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc