Skip to content

feat(ls): add AsyncAPI 3 documentation for new keywords#5102

Merged
robert-hebel-sb merged 27 commits intomainfrom
feat/oss-245-docs-on-hover-for-async3-new-keywords
Feb 3, 2026
Merged

feat(ls): add AsyncAPI 3 documentation for new keywords#5102
robert-hebel-sb merged 27 commits intomainfrom
feat/oss-245-docs-on-hover-for-async3-new-keywords

Conversation

@robert-hebel-sb
Copy link
Contributor

Add AsyncAPI 3.0 Documentation and Configuration Support

Summary

This PR adds comprehensive documentation and configuration support for AsyncAPI 3.0 specification in the language server (apidom-ls). It builds upon the work done in PR #5095 by completing the documentation coverage for all AsyncAPI 3.0 objects and properties.

What Changed

1. New AsyncAPI 3.0 Configuration Directories

Added complete configuration structure for 5 new AsyncAPI 3.0-specific objects:

  • messages/ - Messages Object configuration
  • operations/ - Operations Object configuration
  • operation-reply/ - Operation Reply Object configuration
  • operation-reply-address/ - Operation Reply Address Object configuration
  • multi-format-schema/ - Multi Format Schema Object configuration

Each directory includes:

  • documentation.ts - Hover documentation with links to AsyncAPI 3.0 spec
  • completion.ts - Empty completion arrays (reserved for future use)
  • lint/index.ts - Linting configuration structure
  • meta.ts - Metadata configuration
  • All registered in config.ts

2. AsyncAPI 3.0 Support for Channel Item

Enhanced channel-item/ configuration with AsyncAPI 3.0 properties:

New Properties Documented:

  • address - String representation of the channel's address
  • messages - Map of messages sent to this channel
  • title - Human-readable title
  • summary - Short summary
  • tags - List of tags
  • externalDocs - External documentation
  • servers - Servers this channel is available on
  • parameters - Parameters in the channel address
  • bindings - Protocol-specific bindings

New Lint Rules:

  • allowed-fields-3-0.ts - Validates allowed fields for AsyncAPI 3.0
  • address--type.ts - Type validation for address
  • messages--type.ts - Type validation for messages
  • title--type.ts - Type validation for title
  • summary--type.ts - Type validation for summary
  • tags--type.ts - Type validation for tags
  • external-docs--type.ts - Type validation for externalDocs

3. Completed Missing Documentation

Added missing documentation for several AsyncAPI objects:

asyncapi3/documentation.ts

  • Added comprehensive AsyncAPI Object documentation with all fixed fields (asyncapi, id, info, servers, defaultContentType, channels, operations, components)

operation/documentation.ts

  • Added missing required channel property documentation

components/documentation.ts

  • Added missing operations property documentation

security-requirement/documentation.ts

  • Added AsyncAPI 3.0-specific variant with updated role names support

4. JSON Schema Support for AsyncAPI 3.0

Updated common/schema/documentation.ts to extend all JSON Schema keywords for AsyncAPI 3.0:

Updated 46 JSON Schema keywords to support AsyncAPI 3.0:

  • Type validation: type, enum, const
  • Numeric validation: multipleOf, maximum, minimum, exclusiveMaximum, exclusiveMinimum
  • String validation: maxLength, minLength, pattern
  • Array validation: items, additionalItems, maxItems, minItems, uniqueItems, contains
  • Object validation: maxProperties, minProperties, required, properties, patternProperties, additionalProperties, dependencies, propertyNames
  • Conditional: if, then, else
  • Boolean logic: allOf, anyOf, oneOf, not
  • Reference: $ref
  • Metadata: title, description, examples, deprecated

AsyncAPI-specific Schema Properties:

  • default - Added AsyncAPI 3.0 support (value must conform to defined type)
  • discriminator - Added separate AsyncAPI 3.0 entry with updated spec links
  • externalDocs - Added separate AsyncAPI 3.0 entry with updated spec links

5. Documentation

Added CLAUDE.md to help future Claude Code instances understand the repository structure and development workflow.

Key Technical Details

AsyncAPI 2.0 vs 3.0 Major Differences

  • Channels: In v2, channels had subscribe/publish; in v3, they have messages + address
  • Operations: Moved from channel-level to top-level with action, channel, and reply properties
  • Server: Changed from url to host + pathname; added title, summary, externalDocs
  • Messages: Added MultiFormatSchema support
  • Components: Added operations, replies, and replyAddresses

Documentation Pattern

All documentation entries follow this pattern:

{
  target: 'propertyName',  // or docs for object-level documentation
  docs: '#### [Object Name](spec-url)...',  // Markdown with spec links
  targetSpecs: AsyncAPI3,  // or [...AsyncAPI2, ...AsyncAPI3] for shared docs
}

Completion Pattern

All completion files are currently empty arrays:

const completion: ApidomCompletionItem[] = [];
export default completion;

Files Changed

  • 36 files changed: 633 insertions(+), 48 deletions(-)
  • New directories: 5 configuration directories for AsyncAPI 3.0 objects
  • New files: 31 new configuration and documentation files
  • Updated files: 5 existing documentation files enhanced with AsyncAPI 3.0 support

References

ShikhaSaboo and others added 12 commits January 12, 2026 17:19
This commit completes AsyncAPI 3 documentation support by updating:
- asyncapi3/documentation.ts: Added comprehensive AsyncAPI Object documentation
- components/documentation.ts: Added missing operations property
- operation/documentation.ts: Added required channel property
- security-requirement/documentation.ts: Added AsyncAPI 3 variant with role names support
- common/schema/documentation.ts: Extended all JSON Schema keywords to support AsyncAPI 3

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@robert-hebel-sb robert-hebel-sb changed the title Feat/oss 245 docs on hover for async3 new keywords feat: add documentation support for async3 new keywords Jan 20, 2026
@robert-hebel-sb robert-hebel-sb added enhancement New feature or request AsyncAPI 3.x labels Jan 20, 2026
@robert-hebel-sb robert-hebel-sb changed the title feat: add documentation support for async3 new keywords feat(ls): add AsyncAPI 3 completion for new keywords Jan 20, 2026
@robert-hebel-sb robert-hebel-sb changed the title feat(ls): add AsyncAPI 3 completion for new keywords feat(ls): add AsyncAPI 3 documentation for new keywords Jan 20, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

robert-hebel-sb and others added 2 commits January 22, 2026 10:33
…-compatible-properties' into feat/oss-245-docs-on-hover-for-async3-new-keywords

# Conflicts:
#	packages/apidom-ls/src/config/common/schema/documentation.ts
- Create separate channel config for AsyncAPI 3 (Channel Object vs Channel Item Object)
- Move AsyncAPI 3 rules from channel-item to new channel folder
- Add field description tables to all AsyncAPI 3 object documentation
- Mark required fields explicitly with REQUIRED prefix in documentation
- Add Reference Object notes where specification requires them
- Add runtime expression note to Operation Reply Address
- Remove invalid AsyncAPI 3 Security Requirement Object documentation
- Update AsyncAPI 3 root object description to match specification
- Update lint rules for Channel Object to use Reference Objects for servers

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 48 out of 48 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@robert-hebel-sb robert-hebel-sb marked this pull request as draft January 22, 2026 10:11
robert-hebel-sb and others added 2 commits January 22, 2026 11:16
- Move individual field entries before object-level docs in multi-format-schema
- Move individual field entries before object-level docs in operation-reply
- This ensures field-specific hover documentation displays correctly
- Operations documentation already follows correct pattern with patterned fields

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@robert-hebel-sb robert-hebel-sb marked this pull request as ready for review January 22, 2026 11:00
Base automatically changed from feat/OSS-254/251-add-config-and-docs-for-asyncapi3-with-compatible-properties to main January 23, 2026 07:34
…ywords

# Conflicts:
#	packages/apidom-ls/src/config/asyncapi/asyncapi3/documentation.ts
#	packages/apidom-ls/src/config/asyncapi/components/documentation.ts
#	packages/apidom-ls/src/config/asyncapi/operation/documentation.ts
#	packages/apidom-ls/src/config/common/schema/documentation.ts
robert-hebel-sb and others added 9 commits January 26, 2026 11:16
Addresses review comments from PR #5102:
- Remove duplicate AsyncAPI 3.0 lint rules from channel-item (now in channel)
- Fix channel documentation comment about parameters field
- Correct Multi Format Schema Object schemaFormat property documentation ordering
- Update Multi Format Schema Object table to match property descriptions
- Fix Operations Object patterned field description to match spec

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…ywords

# Conflicts:
#	packages/apidom-ls/src/config/asyncapi/channel/completion.ts
#	packages/apidom-ls/src/config/asyncapi/channel/documentation.ts
#	packages/apidom-ls/src/config/asyncapi/channel/lint/bindings--type.ts
#	packages/apidom-ls/src/config/asyncapi/channel/lint/description--type.ts
#	packages/apidom-ls/src/config/asyncapi/channel/lint/index.ts
#	packages/apidom-ls/src/config/asyncapi/channel/lint/parameters--type.ts
Add comprehensive Message Object documentation for AsyncAPI 3.0.0
including fixed fields table, Message Example Object details,
and examples in JSON and YAML formats.

Key differences from AsyncAPI 2:
- headers/payload support Multi Format Schema Object
- externalDocs can be a Reference Object
- traits use new merge mechanism
- removed messageId and schemaFormat fields

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Remove Reference Object from externalDocs field documentation in Info, Tag, Channel, Server, Operation, Operation Trait, Message Trait, and Components Objects
- Add Reference Object notation to External Documentation Object itself (can be referenced as component)
- Aligns documentation with AsyncAPI 3.0.0 specification

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…ssage documentation

- Add comprehensive schema formats table showing required (AsyncAPI 3.0.0, JSON Schema Draft 07) and recommended (Avro, OpenAPI, RAML, Protocol Buffers) formats
- Add JSON and YAML examples demonstrating Avro schema usage with Multi Format Schema Object
- Aligns AsyncAPI 3 documentation completeness with AsyncAPI 2 documentation

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…Object

- Add formal JSON Schema specification documentation for 'properties' keyword
- Explain validation behavior: validates child instances against corresponding schemas
- Match documentation style used in common/schema for consistency
- Clarify that omitting the keyword behaves as an empty object

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@robert-hebel-sb robert-hebel-sb merged commit 5e29dad into main Feb 3, 2026
8 of 9 checks passed
@robert-hebel-sb robert-hebel-sb deleted the feat/oss-245-docs-on-hover-for-async3-new-keywords branch February 3, 2026 09:05
robert-hebel-sb added a commit that referenced this pull request Feb 3, 2026
Addresses review comments from PR #5102:
- Remove duplicate AsyncAPI 3.0 lint rules from channel-item (now in channel)
- Fix channel documentation comment about parameters field
- Correct Multi Format Schema Object schemaFormat property documentation ordering
- Update Multi Format Schema Object table to match property descriptions
- Fix Operations Object patterned field description to match spec

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AsyncAPI 3.x enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants