Skip to content

feat!: release v6#2362

Draft
jonaslagoni wants to merge 26 commits intomasterfrom
next
Draft

feat!: release v6#2362
jonaslagoni wants to merge 26 commits intomasterfrom
next

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 daa2412
🔍 Latest deploy log https://app.netlify.com/projects/modelina/deploys/698b93e1afab790008fe0f2f

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 3 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 3 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

Comment on lines +12 to +36
test:
name: Runtime testing Go Models
if: "github.event.pull_request.draft == false &&!((github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'ci: update global workflows')) || (github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'chore(release):')) || (github.actor == 'allcontributors' && startsWith(github.event.pull_request.title, 'docs: add')))"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Check package-lock version
uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master
id: lockversion
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "${{ steps.lockversion.outputs.version }}"
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Build Library
run: npm install && npm run build:prod
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Generate Go Models
run: npm run generate:runtime:go
- name: Run runtime Tests

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 3 days ago

In general, the fix is to explicitly declare a permissions block in the workflow (at the root level or per job) that grants only the scopes required. This workflow just checks out code and runs Node.js and Go commands, so it only needs read access to repository contents; no write scopes are required.

The best fix with minimal functional impact is to add a root-level permissions block directly under the name: declaration so it applies to all jobs. In .github/workflows/runtime-go-testing.yml, add:

permissions:
  contents: read

on new lines after line 1 (name: Runtime Testing Go Models). No other changes, imports, or additional configuration are needed.

Suggested changeset 1
.github/workflows/runtime-go-testing.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/runtime-go-testing.yml b/.github/workflows/runtime-go-testing.yml
--- a/.github/workflows/runtime-go-testing.yml
+++ b/.github/workflows/runtime-go-testing.yml
@@ -1,4 +1,6 @@
 name: Runtime Testing Go Models
+permissions:
+  contents: read
 on:
   push:
   pull_request:
EOF
@@ -1,4 +1,6 @@
name: Runtime Testing Go Models
permissions:
contents: read
on:
push:
pull_request:
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.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
D Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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.

4 participants