You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Schema type badge does not show [TypeName] for non-object schemas with title (e.g. enums show as plain "string" instead of "string [OrderStatus]") #1308
When a named enum (or any non-object schema) has a title set, the type badge renders the bare primitive type (e.g. string) without appending [TypeName].
Object schemas with a title already display correctly as object [TypeName], this behaviour is missing for other types.
Steps to reproduce
Expand the Order schema in the playground with this spec and look at the status property type badge.
In library/src/helpers/schema.ts, toSchemaType() only appends [title]
when type === 'object':
if (type === 'object' && schema.title()) {
type += ' [' + schema.title() + ']';
}
Suggested fix
if (schema.title() && type !== schema.title()) {
type += ' [' + schema.title() + ']';
}
The type !== schema.title() guard prevents degenerate output like string [string]. This is consistent with existing object behaviour, it simply extends it to all named schema types.
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request. Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
Hi, I rechecked the current master branch and the relevant toSchemaType() code path is still unchanged, so this issue still applies.
I have a focused fix and regression tests prepared. The intended scope is to:
append [title] to named scalar/inferred-enum and array schema type badges,
avoid duplicate output when the rendered type already matches the title,
preserve the existing early-return behavior for union types and oneOf/anyOf/allOf composition rather than broadening this change into a larger formatting refactor,
add both helper-level coverage and a component-level assertion for the visible badge.
Would maintainers approve this scope and be okay with me opening a PR? I’ll run the full repository test/lint checks before submitting it.
Hi, I rechecked the current master branch and the relevant toSchemaType() code path is still unchanged, so this issue still applies.
I have a focused fix and regression tests prepared. The intended scope is to:
append [title] to named scalar/inferred-enum and array schema type badges,
avoid duplicate output when the rendered type already matches the title,
preserve the existing early-return behavior for union types and oneOf/anyOf/allOf composition rather than broadening this change into a larger formatting refactor,
add both helper-level coverage and a component-level assertion for the visible badge.
Would maintainers approve this scope and be okay with me opening a PR? I’ll run the full repository test/lint checks before submitting it.
I reproduced this and have a small fix ready. It extends the existing title suffix behavior to non-object schemas while avoiding duplicate output when the title matches the inferred type. I also added regression tests for a titled string schema and the duplicate-title case. May I take this issue and open the PR?
Hi @AceTheCreator! As discussed, I've opened PR #1361 resolving this issue. It appends [schema.title()] to the type badge for non-object schemas (such as named enums and scalars) while preventing duplicate output when the title matches the inferred type. Full helper unit tests and component tests are included. Ready for review!
Activity
github-actions commentedon Jun 30, 2026
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
Jannik-cmyk commentedon Aug 7, 2026
Hi, I rechecked the current
masterbranch and the relevanttoSchemaType()code path is still unchanged, so this issue still applies.I have a focused fix and regression tests prepared. The intended scope is to:
[title]to named scalar/inferred-enum and array schema type badges,oneOf/anyOf/allOfcomposition rather than broadening this change into a larger formatting refactor,Would maintainers approve this scope and be okay with me opening a PR? I’ll run the full repository test/lint checks before submitting it.
AceTheCreator commentedon Sep 16, 2026
Feel free to open a PR
MaybeSomeone-arc18 commentedon Sep 22, 2026
I reproduced this and have a small fix ready. It extends the existing title suffix behavior to non-object schemas while avoiding duplicate output when the title matches the inferred type. I also added regression tests for a titled string schema and the duplicate-title case. May I take this issue and open the PR?
viky-01 commentedon Oct 6, 2026
Hi @AceTheCreator! As discussed, I've opened PR #1361 resolving this issue. It appends
[schema.title()]to the type badge for non-object schemas (such as named enums and scalars) while preventing duplicate output when the title matches the inferred type. Full helper unit tests and component tests are included. Ready for review!fix(schema): append title to non-object schema type badge (asyncapi#1308
fix(schema): append title to non-object schema type badge (#1308) (#1361
asyncapi-bot commentedon Oct 16, 2026
🎉 This issue has been resolved in version 3.2.2 🎉
The release is available on:
Your semantic-release bot 📦🚀