asyncapi / community

AsyncAPI community-related stuff.
https://www.asyncapi.com/community
98 stars 107 forks source link

Essential building blocks: Vision for each tool #1158

Closed jonaslagoni closed 4 months ago

jonaslagoni commented 6 months ago

Setting a vision for each of these:

jonaslagoni commented 6 months ago

JSON Schema files for AsyncAPI

Is the single source of truth for what is a valid AsyncAPI document (no matter what the specification says). With the exception of dynamic governance rules such as "examples must match the payload type".

Features include:

Parser

Does not matter which language you build a tool in, you should be able to parse an AsyncAPI document, validate it (or not), and programmably interact with the document to get (or change?) the information.

Features include:

Code first tool

Engineers should always easily be able to use code to document their application, and get an AsyncAPI document out in the other end, so they don't have to deal with design first approach. No matter what language they use.

Features include:

Schema registry

You can store a full AsyncAPI document, or partial documents in a schema store, either privately or publically, that each tool will be able to use.

Features include:

Integration into existing frameworks

It should be easy to use AsyncAPI in your existing (any) framework and development workflow, so as a developer you can reap all the benefits with AsyncAPI instantly.

Features include:

Code generators

Should be easy to save time, help catch bugs, and improve code in the development process by using AsyncAPI documents to generate code from the AsyncAPI document.

Features include:

lorenzsimon commented 6 months ago

JSON Schema:

Parser:

Code first tools:

Schema registry:

Integration into existing frameworks: (is part of code first tools and code generators)

Code generators:

Souvikns commented 6 months ago

JSON Schema for validating AsyncAPI Documents

Parsers

Code first tools

Schema registry

Code generators

Integrating with existing frameworks

VisualBean commented 6 months ago

JSON Schema files for AsyncAPI

Single source of truth for the AsyncAPI specification. Used by parsers and other tools to validate whether they got it right or not. TCK is a good example of what i'm thinking.

Parser

Parse the asyncapi specification, into language specific models and back again.

Code first tool

Saunter like tooling for main languages. Generating asyncapi specs, from a code first approach. Would be great with a framework for this, to make it better integrated with code side broker setup, than simply chaining methods that do nothing except define the specification.

Schema registry

Integration into existing frameworks

Code generators

jonaslagoni commented 6 months ago

Current merged visions

JSON Schema files for AsyncAPI

Is the single source of truth for what is a valid AsyncAPI document (no matter what the specification says).

With the exception of dynamic governance rules such as "examples must match the payload type".

Features include:

Parser

Does not matter which language you build a tool in, you should be able to parse an AsyncAPI document, validate it (or not), and programmable interact with the document to get (or change?) the information.

Features include:

Code first tool

Engineers should always easily be able to use code to document their application and get an AsyncAPI document out in the other end, so they don't have to deal with design first approach.

Features include:

Schema registry

You can store a full AsyncAPI document, or partial documents in a schema registry, either privately or publicly, that each tool will be able to use.

Features include:

Code generators

Should be easy to save time, help catch bugs, and improve code in the development process by using the AsyncAPI documents to generate code.

Features include:

lorenzsimon commented 6 months ago

Priorities

JSON Schema files for AsyncAPI

(must have) - Are "well tested" to ensure we don't accidentally break stuff (must have) - Can validate partial AsyncAPI documents, i.e. only validate Message Object (must have) - Integrated with various IDE's (autocomplete and validation) (should have) - Can be used across all programming languages (should have) - Distributed documentation (reusable components) -> references (should have) - Should follow validity rules like "server must be a uri". (can have) - Can validate all official bindings and compatible versions

Parser

(must have) - Provide an interface to access 1 to 1 representation of the AsyncAPI structure (must have) - Load AsyncAPI documents from file, url and supported data structure. (must have) - Has great documentation so the users know how to use the tool (must have) - Serialize and deserialize the AsyncAPI documents (must have) - Show meaningful and helpful error messages if an invalid specification (should have) - Ensure we have proper testing kits across parser implementations (should have) - Follow language specific conventions, but have the same look and feel across languages. (should have) - Can validate AsyncAPI documents, including bindings, extensions, and different schema formats (should have) - Production-level interaction that separates the AsyncAPI version and how you get information (can have) - Can handle all possible references, including private registries, local files, non-JSON/YAML references i.e. protobuf etc (might need spec change) (can have) - Can handle custom schemaFormat's both parsing them and validating them

Code first tool

(must have) - Can output AsyncAPI documents from code (must have) - Can document an application through code in any language (must have) - Can be integrated into existing frameworks (must have) - Generate JSON Schema (or others) from message payload types (should have) - Can annotate anything in code that AsyncAPI specification allows (can have) - Can output the reverse perspective ("client") AsyncAPI documents from code (can have) - Can easily be integrated into broker interaction

Schema registry

(must have) - Can be used as part of all parsers and therefore all subsequent tools (must have) - Provides an API to store and retrieve documents, so it can be used as part of a larger integration (must have) - Can handle multiple versions of schemas in an intuitive way (must have) - Can add full AsyncAPI document (must have) - Can add partial AsyncAPI documents (anything that can be a component) (can have) - Can be used as part of a platform

Code generators

(must have) - Typed models for AsyncAPI Message payloads (must have) - Typed models for AsyncAPI headers (must have) - Typed models topic/message matrix (must have) - Follows best practices of the language and framework (must have) - Can be integrated into any existing framework (should have) - Is customizable so users can create their own code generators (can have) - Helper functions for interacting with defined channels through the provided client (can have) - Can generate full libraries that "externals" can use to interact with a specific application/system

jonaslagoni commented 6 months ago

Priority list

JSON Schema files for AsyncAPI

MUST HAVE;

SHOULD HAVE;

CAN HAVE;

Parser

MUST HAVE;

SHOULD HAVE;

CAN HAVE;

Code first tool

MUST HAVE;

SHOULD HAVE;

CAN HAVE;

Schema registry

MUST HAVE;

SHOULD HAVE;

CAN HAVE;

jonaslagoni commented 5 months ago

Proposed priority list from @Souvikns @lorenzsimon and me:

JSON Schema files for AsyncAPI

(must have) - Are "well tested" to ensure we don't accidentally break stuff (must have) - Can be used across all programming languages (must have) - Can validate partial AsyncAPI documents, i.e. only validate Message Object (must have) - Integrated with various IDE's (autocomplete and validation) (should have) - Should follow validity rules like "server must be a URI" (should have) - Can validate all official bindings and compatible versions (should have) - Distributed documentation (reusable components) -> references

Parser

(must have) - Provide an interface to access 1 to 1 representation of the AsyncAPI structure (must have) - Load AsyncAPI documents from file, url and supported data structure. (must have) - Has great documentation so the users know how to use the tool (must have) - Serialize and deserialize the AsyncAPI documents (must have) - Show meaningful and helpful error messages if an invalid specification (should have) - Ensure we have proper testing kits across parser implementations (should have) - Follow language specific conventions, but have the same look and feel across languages. (should have) - Can validate AsyncAPI documents, including bindings, extensions, and different schema formats (should have) - Production-level interaction that separates the AsyncAPI version and how you get information (can have) - Can handle all possible references, including private registries, local files, non-JSON/YAML references i.e. protobuf etc (might need spec change) (can have) - Can handle custom schemaFormat's both parsing them and validating them

Code first tool

(must have) - Can output AsyncAPI documents from code (Generate JSON Schema (or others) from message payload types) (must have) - Can document an application through code in any language (must have) - Can be integrated into existing frameworks (should have) - Can annotate anything in code that AsyncAPI specification allows (can have) - Can output the reverse perspective ("client") AsyncAPI documents from code (can have) - Can easily be integrated into broker interaction

Schema registry

(must have) - Can be used as part of all parsers and therefore all subsequent tools (must have) - Provides an API to store and retrieve documents, so it can be used as part of a larger integration (must have) - Can handle multiple versions of schemas in an intuitive way (must have) - Can add full AsyncAPI document (must have) - Can add partial AsyncAPI documents (anything that can be a component) (can have) - Can be used as part of a platform

Code generators

(must have) - Typed models for AsyncAPI Message payloads (must have) - Typed models for AsyncAPI headers (must have) - Typed models topic/message matrix (must have) - Follows best practices of the language and framework (must have) - Can be integrated into any existing framework (should have) - Is customizable so users can create their own code generators (can have) - Helper functions for interacting with defined channels through the provided client (can have) - Can generate full libraries that "externals" can use to interact with a specific application/system