feat(ls): add AsyncAPI 3 validation for compatible keywords#5096
Merged
feat(ls): add AsyncAPI 3 validation for compatible keywords#5096
Conversation
17 tasks
391bc33 to
515fa34
Compare
cka121
approved these changes
Jan 20, 2026
robert-hebel-sb
approved these changes
Jan 20, 2026
Base automatically changed from
feat/OSS-254/251-add-config-and-docs-for-asyncapi3-with-compatible-properties
to
main
January 23, 2026 07:34
515fa34 to
e061ec6
Compare
robert-hebel-sb
added a commit
that referenced
this pull request
Jan 30, 2026
Add comprehensive lint validation rules for AsyncAPI 3.0.0 new and updated keywords following patterns from PR #5096. Root level: - operations field type validation Operation Object: - action (required) type and required field validation with quickFix - channel (required) type and required field validation with quickFix - title type validation - reply type validation - messages type validation (updated stub) Parameter Object: - enum type validation (array) - default type validation - examples type validation (array) Components Object: - operations values type validation Operations Object (root operations): - values type validation for operation objects map Messages Object: - values type validation for message objects map Server Object: - externalDocs type validation Info Object: - externalDocs type validation (updated stub) Error codes added to codes.ts: - ASYNCAPI3_ASYNC_API_FIELD_OPERATIONS_TYPE - ASYNCAPI3_OPERATION section (2080000-2080500) - ASYNCAPI3_SERVER section (2090000-2090500) - ASYNCAPI3_INFO section (2100000-2100200) - ASYNCAPI3_COMPONENTS section (2110000-2110100) - ASYNCAPI3_PARAMETER section (2120000-2120300) - ASYNCAPI3_OPERATIONS section (2130000-2130100) - ASYNCAPI3_MESSAGES section (2140000-2140100) All lint rules include appropriate error codes, validation messages, linter functions, and target AsyncAPI 3.0.0 specification. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
robert-hebel-sb
added a commit
that referenced
this pull request
Feb 3, 2026
Add comprehensive lint validation rules for AsyncAPI 3.0.0 new and updated keywords following patterns from PR #5096. Root level: - operations field type validation Operation Object: - action (required) type and required field validation with quickFix - channel (required) type and required field validation with quickFix - title type validation - reply type validation - messages type validation (updated stub) Parameter Object: - enum type validation (array) - default type validation - examples type validation (array) Components Object: - operations values type validation Operations Object (root operations): - values type validation for operation objects map Messages Object: - values type validation for message objects map Server Object: - externalDocs type validation Info Object: - externalDocs type validation (updated stub) Error codes added to codes.ts: - ASYNCAPI3_ASYNC_API_FIELD_OPERATIONS_TYPE - ASYNCAPI3_OPERATION section (2080000-2080500) - ASYNCAPI3_SERVER section (2090000-2090500) - ASYNCAPI3_INFO section (2100000-2100200) - ASYNCAPI3_COMPONENTS section (2110000-2110100) - ASYNCAPI3_PARAMETER section (2120000-2120300) - ASYNCAPI3_OPERATIONS section (2130000-2130100) - ASYNCAPI3_MESSAGES section (2140000-2140100) All lint rules include appropriate error codes, validation messages, linter functions, and target AsyncAPI 3.0.0 specification. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR:
targetSpecsto every validation rule to apply them to select AsyncAPI versionsadditional-items--type-openapi-3-1--asyncapi-2=>additional-items--type-openapi-3-1--asyncapi-2--3,allowed-fields=>allowed-fields-2-0--2-6). This does not apply for rules that are specific to keywords that exist only in AsyncAPI 2 (e.g.operationIdfield in Operation Object exists only in AsyncAPI 2, so the ruleoperation-id--typewas not renamed).NOTE 1: There are cases where the allowed fields are technically the same (e.g. Tag Object and External Documentation Object), but it is now possible to reference these objects. As such, it seems to me that the allowed fields rule needs to be extended to include
$refas well, which is why I made it, and the rules for required fields, specific to AsyncAPI 2. If that is not what should happen, I will include Async3 in thetargetSpecsas well.NOTE 2: Similar to the cases above, Channel Object can be referenced, but it no longer has the
$reffield like the Channel Item Object in AsyncAPI 2. This allowed the$refto have siblings, which is not possible otherwise when the object is referenced. As such, I ported over the existing rule ($refValidLint) and added one which disallows siblings when$refexists ($refNoSiblingsLint). If that's not valid, I'll remove these rules.NOTE 3: For now I chose not to add
targetSpecsto any binding, as I noted in #5095 (comment) that I think they are meant to work with any spec. If that's not the case, let me know and I'll try to go through each of them and check iftargetSpecsshould be specific to 2.0.x or 3.0.0, or if it should apply to both of them. Some of them are also outdated as noted in #5095 (comment) - I think it needs to be handled separately => I created a separate task for this.TODO:
bindings$ref, this error is shown:"variables' values must be of Server Variable Object shape"- this happens for both Async 2 and Async 3 - addressed in fix(ns-asyncapi-2): add missing reference metadata to server variables #5098additional-items--type-openapi-3-1--asyncapi-2=>additional-items--type-openapi-3-1--asyncapi-2--3,allowed-fields=>allowed-fields-2-0--2-6)