Skip to content

Commit

Permalink
fix: fix includes encode character causing allowedTags function error
Browse files Browse the repository at this point in the history
  • Loading branch information
rookie-luochao committed Oct 27, 2024
1 parent c8162ea commit 430c164
Show file tree
Hide file tree
Showing 4 changed files with 1,557 additions and 341 deletions.
5 changes: 5 additions & 0 deletions .changeset/modern-suns-unite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'openapi-ts-request': patch
---

fix: fix $ref includes encode character causing allowedTags function error
2 changes: 1 addition & 1 deletion src/generator/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ export function markAllowSchema(
schemaStr: string,
schemas: ComponentsObject['schemas']
) {
const refs = schemaStr?.match(/#\/components\/schemas\/([A-Za-z0-9._-]+)/g);
const refs = schemaStr?.match(/#\/components\/schemas\/([\w%«».-]+)/g);

forEach(refs, (ref) => {
const schema = schemas?.[getLastRefName(ref)] as ICustomSchemaObject;
Expand Down
Loading

0 comments on commit 430c164

Please sign in to comment.