-
-
Notifications
You must be signed in to change notification settings - Fork 223
feat!: release v6 #2362
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
base: master
Are you sure you want to change the base?
feat!: release v6 #2362
Conversation
✅ Deploy Preview for modelina canceled.
|
feat: support non-object model types for rust Those model types are common when using GET parameters in an OpenAPI document. Typescript already has a TypeRenderer. This adds an equivalent for Rust. However, instead of using a Rust type aliases, this PR uses the New Type Idiom. There are two main advantages to using the New Type idiom: compile-time value type validation and a bypass of the rust orphan rule (see https://effective-rust.com/newtype.html). The second advantage will be needed to implement model validation. Likely this validation will come from an external trait. Rust only allows adding external trait implementations to types that are internal to the crate (type aliases do not count).
| const sanitized = schemaId | ||
| .replace('<', '') | ||
| .replace(/-/g, '_') | ||
| .replace('>', ''); |
Check failure
Code scanning / CodeQL
Incomplete string escaping or encoding High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 2 months ago
To ensure that all occurrences of the < and > characters within schemaId are removed (not just the first one), the .replace method should be called with a regular expression using the global flag /g. That is, replace .replace('<', '') with .replace(/</g, ''), and similarly for >. Only edit the lines of code where this occurs, maintaining the rest of the code unchanged. No new imports or auxiliary methods are needed, as regular expressions are natively supported in JavaScript/TypeScript.
-
Copy modified line R585 -
Copy modified line R587
| @@ -582,9 +582,9 @@ | ||
| // Priority 7: Fallback to sanitized anonymous ID | ||
| if (schemaId?.includes(AsyncAPIInputProcessor.ANONYMOUS_PREFIX)) { | ||
| const sanitized = schemaId | ||
| .replace('<', '') | ||
| .replace(/</g, '') | ||
| .replace(/-/g, '_') | ||
| .replace('>', ''); | ||
| .replace(/>/g, ''); | ||
| Logger.debug(`Using sanitized anonymous ID: ${sanitized}`); | ||
| return sanitized; | ||
| } |
| const sanitized = schemaId | ||
| .replace('<', '') |
Check failure
Code scanning / CodeQL
Incomplete string escaping or encoding High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 2 months ago
The best way to fix this issue is to ensure that all occurrences of the problematic meta-characters (specifically < and >) are removed from the string, not just the first occurrence. This should be done using a global regular expression in the .replace method.
In src/processors/AsyncAPIInputProcessor.ts, locate the code block on line 584 where schemaId.replace('<', '').replace(/-/g, '_').replace('>', '') appears, and modify the code to use .replace(/</g, '') and .replace(/>/g, ''). This ensures every occurrence of < and > in schemaId is removed correctly (and all -s are replaced with _). No additional imports are needed; this is built-in JavaScript functionality. No changes to functionality beyond proper sanitization will occur.
-
Copy modified line R585 -
Copy modified line R587
| @@ -582,9 +582,9 @@ | ||
| // Priority 7: Fallback to sanitized anonymous ID | ||
| if (schemaId?.includes(AsyncAPIInputProcessor.ANONYMOUS_PREFIX)) { | ||
| const sanitized = schemaId | ||
| .replace('<', '') | ||
| .replace(/</g, '') | ||
| .replace(/-/g, '_') | ||
| .replace('>', ''); | ||
| .replace(/>/g, ''); | ||
| Logger.debug(`Using sanitized anonymous ID: ${sanitized}`); | ||
| return sanitized; | ||
| } |
|
🎉 This PR is included in version 6.0.0-next.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|



Placeholder for v6 release