Skip to content

Conversation

@jonaslagoni
Copy link
Member

@jonaslagoni jonaslagoni commented Nov 4, 2025

Placeholder for v6 release

@netlify
Copy link

netlify bot commented Nov 4, 2025

Deploy Preview for modelina canceled.

Name Link
🔨 Latest commit 29eac76
🔍 Latest deploy log https://app.netlify.com/projects/modelina/deploys/6941edeac872960008075e4d

asyncapi-bot and others added 4 commits November 5, 2025 18:27
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).
Comment on lines +584 to +587
const sanitized = schemaId
.replace('<', '')
.replace(/-/g, '_')
.replace('>', '');

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding High

This replaces only the first occurrence of '>'.

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.


Suggested changeset 1
src/processors/AsyncAPIInputProcessor.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/processors/AsyncAPIInputProcessor.ts b/src/processors/AsyncAPIInputProcessor.ts
--- a/src/processors/AsyncAPIInputProcessor.ts
+++ b/src/processors/AsyncAPIInputProcessor.ts
@@ -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;
     }
EOF
@@ -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;
}
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +584 to +585
const sanitized = schemaId
.replace('<', '')

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding High

This replaces only the first occurrence of '<'.

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.


Suggested changeset 1
src/processors/AsyncAPIInputProcessor.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/processors/AsyncAPIInputProcessor.ts b/src/processors/AsyncAPIInputProcessor.ts
--- a/src/processors/AsyncAPIInputProcessor.ts
+++ b/src/processors/AsyncAPIInputProcessor.ts
@@ -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;
     }
EOF
@@ -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;
}
Copilot is powered by AI and may make mistakes. Always verify output.
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 6.0.0-next.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants