docs(subscriptions): add OpenAPI/Swagger decorators to entity and con… - #1341
Open
pharwasz wants to merge 1 commit into
Open
docs(subscriptions): add OpenAPI/Swagger decorators to entity and con…#1341pharwasz wants to merge 1 commit into
pharwasz wants to merge 1 commit into
Conversation
…troller - Add @ApiProperty/@ApiPropertyOptional to Subscription entity fields - Add @apitags, @apioperation, @apiresponse to all 7 subscription endpoints - Document 401/400/404/402 responses - Regenerate OpenAPI spec and docs site
|
@pharwasz Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
Well done on the job done so far! |
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.
Summary
Adds complete OpenAPI/Swagger documentation to the subscriptions module — entity schema and all controller endpoints — so they render properly in Swagger UI.
Changes
src/payments/entities/subscription.entity.ts@ApiProperty/@ApiPropertyOptionaldecorators to all fields for correct schema generationsrc/payments/subscriptions/subscriptions.controller.ts@ApiTags— controller grouped under "Subscriptions"@ApiOperation— summaries added to all 7 endpoints@ApiResponse— documented per endpoint:Subscriptionschema401 Unauthorized(JWT auth required)400 Bad Request(validation errors)404 Not Found(missing resources)402 Payment Required(upgrade endpoint payment failures)Verification
scripts/generate-api-docs.js) is static and doesn't scan controllers dynamically, so it can't be used to spot-check this eitherThe decorator syntax and structure follow existing NestJS Swagger conventions used elsewhere in the codebase, so this should render correctly once the app builds — but it has not been visually confirmed in Swagger UI.
Follow-up needed
/api-docs(or wherever Swagger is mounted) renders the Subscriptions section correctlyopenapi-spec.json/docs/siteoutput and commit separately once verified (kept out of this PR intentionally)Type of change
close #1312