Skip to content

Respect setMessageOwnersToServiceOwners option in OpenAPI generator#427

Merged
boyney123 merged 1 commit into
mainfrom
fix/openapi-set-message-owners-to-service-owners
Jul 17, 2026
Merged

Respect setMessageOwnersToServiceOwners option in OpenAPI generator#427
boyney123 merged 1 commit into
mainfrom
fix/openapi-set-message-owners-to-service-owners

Conversation

@boyney123

Copy link
Copy Markdown
Contributor

Resolves event-catalog/eventcatalog#2721

What This PR Does

Fixes the setMessageOwnersToServiceOwners service option in the OpenAPI generator. The option was effectively ignored (always evaluating to true) and was also being written onto the generated service object as an unexpected property. It now defaults to true, correctly honours false, and no longer leaks into the service.

Changes Overview

Key Changes

  • Stop writing setMessageOwnersToServiceOwners onto the built service object in utils/services.ts (the || true fallback made it always true).
  • Read the option in index.ts with a proper ?? true default and use it to decide whether service owners are applied to messages.
  • Add test coverage: the option no longer appears as a service property, and when set to false, service owners are not added to messages.

How It Works

Previously buildService set setMessageOwnersToServiceOwners: serviceOptions.setMessageOwnersToServiceOwners || true, which always resolved to true and persisted the flag on the service. The generator then read it back off the service. The logic now resolves the option once in index.ts (serviceSpec.setMessageOwnersToServiceOwners ?? true) and passes the resulting owners list to message processing, keeping the flag out of the service model entirely.

Breaking Changes

None.

Additional Notes

Tests were not run as part of this change per request.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 40b945b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@eventcatalog/generator-openapi Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@boyney123
boyney123 merged commit cdcc7a9 into main Jul 17, 2026
6 checks passed
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.

Unknown property "setMessageOwnersToServiceOwners"

1 participant