-
-
Notifications
You must be signed in to change notification settings - Fork 528
Operation types are being mapped incorrectly (v7) #1542
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
Comments
Ah great catch. I don’t remember having tests for Not sure whether this was introduced with Redocly’s schema bundling, or just a net-new bug in 7.x. But either way seems like the Would love a PR for this if you (or anyone else) is able! |
Digging in right now. Looks maybe related to this change: Redocly/redocly-cli@4ab6e09#diff-25c0338c90db3454ba7548187ad0db4e1e288ffca3c1d6ef65f45a442e728074 I can figure out a workaround unless you'd prefer I open an issue in Redocly. edit: export function parseRef(ref: string): {
uri: string | null;
pointer: string[];
} {
const [uri, pointer] = ref.split("#/");
return {
uri: uri || null,
pointer: pointer
? pointer.split("/").map(unescapePointer).filter(isTruthy)
: [],
};
} |
No workarounds are fine. Honestly a lot of the delay of 7.x stable being released is filing down some sharp edges with Redocly. I’m glad to be using it—it offloads a ton of complexity I think it’s far better at than this library ever was—but it comes with drawbacks like this.
Ah great catch! On the one hand, yeah this would be easy for them to test in some way. On the other, testing is hard 😅. Either way, I think having the fix live in this repo (and having a test for it) is smart. |
* fix: replace # characters in operation IDs with a slash Fixes #1542 * add hash regex constant
Description
The operation type mapping no longer uses the correct
operationId
keys.openapi-typescript
7.0.0-next.7
21.0.0
macOS 14.2.1
Reproduction
Given an OpenAPI v3 spec
The following types are generated:
As you can see, the
get
method is mapped tooperations["Get"];
, however the operation key is actuallyAccounts#Get
. This only started happening today as far as I can tell. It has generated correctly to date.Expected result
Checklist
npx @redocly/cli@latest lint
)The text was updated successfully, but these errors were encountered: