Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add infoPath to apiItem #968

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import sdk from "postman-collection";

import { sampleRequestFromSchema } from "./createRequestExample";
import { OpenApiObject, TagGroupObject, TagObject } from "./types";
import { loadAndResolveSpec } from "./utils/loadAndResolveSpec";
import { isURL } from "../index";
import {
ApiMetadata,
Expand All @@ -31,6 +30,7 @@ import {
SidebarOptions,
TagPageMetadata,
} from "../types";
import { loadAndResolveSpec } from "./utils/loadAndResolveSpec";

/**
* Convenience function for converting raw JSON to a Postman Collection object.
Expand Down Expand Up @@ -86,6 +86,7 @@ function createItems(
): ApiMetadata[] {
// TODO: Find a better way to handle this
let items: PartialPage<ApiMetadata>[] = [];

const infoIdSpaces = openapiData.info.title.replace(" ", "-").toLowerCase();
const infoId = kebabCase(infoIdSpaces);

Expand Down Expand Up @@ -227,6 +228,7 @@ function createItems(
type: "api",
id: baseId,
infoId: infoId ?? "",
infoPath: infoId ?? "",
unversionedId: baseId,
title: title ? title.replace(/((?:^|[^\\])(?:\\{2})*)"/g, "$1'") : "",
description: operationObject.description
Expand Down
Loading