Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update schema generate for 3rd party brokers #5083

Open
wants to merge 2 commits into
base: mqtt-topic-metadata
Choose a base branch
from

Conversation

knolleary
Copy link
Member

Closes #5082

Description

Adds support for asyncapi schema generation for 3rd party brokers.

  • Updates metadata model definition to provide custom get/set functions - consumers don't need to worry about JSON parse/stringify.
  • Removes a duplicate verifySession preHandler on the routes - the parent route already had it registered
  • Adds the schema button for 3rd party brokers
  • Updates the 'empty' view to cover the inspector panel as well

Copy link

codecov bot commented Feb 6, 2025

Codecov Report

Attention: Patch coverage is 28.33333% with 43 lines in your changes missing coverage. Please review.

Project coverage is 78.38%. Comparing base (c01312f) to head (5dbbeb7).

Files with missing lines Patch % Lines
forge/ee/routes/teamBroker/schema.js 14.00% 43 Missing ⚠️
Additional details and impacted files
@@                   Coverage Diff                   @@
##           mqtt-topic-metadata    #5083      +/-   ##
=======================================================
- Coverage                78.52%   78.38%   -0.15%     
=======================================================
  Files                      337      337              
  Lines                    15779    15822      +43     
  Branches                  3639     3653      +14     
=======================================================
+ Hits                     12391    12402      +11     
- Misses                    3388     3420      +32     
Flag Coverage Δ
backend 78.38% <28.33%> (-0.15%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@hardillb hardillb left a comment

Choose a reason for hiding this comment

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

Looks OK

Just the note about never sending broker.credentials back to the UI for the async api docs bit.

Comment on lines +93 to +96
if (request.broker.credentials) {
const creds = JSON.parse(request.broker.credentials)
if (creds.username && creds.password) {
schema.servers[request.broker.name].security = [{
Copy link
Contributor

Choose a reason for hiding this comment

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

broker.credentials are never returned to the UI

There was talk of sending credentials.username back, but not implemented at the moment.

@@ -1,6 +1,4 @@
module.exports = async function (app) {
app.addHook('preHandler', app.verifySession)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this removed because it's already set somewhere earlier?

@@ -1,8 +1,6 @@
const schemaApi = require('./schema')

module.exports = async function (app) {
app.addHook('preHandler', app.verifySession)
Copy link
Contributor

Choose a reason for hiding this comment

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

same as in 3rdPartyBroker.js?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update asyncapi schema support to include 3rd party brokers
2 participants