Skip to content

fixed swagger issues and ran prettier#29

Merged
omar-dulaimi merged 1 commit into
omar-dulaimi:masterfrom
United-Way-of-Greater-Cincinnati:swagger-api-property-fix
Oct 25, 2025
Merged

fixed swagger issues and ran prettier#29
omar-dulaimi merged 1 commit into
omar-dulaimi:masterfrom
United-Way-of-Greater-Cincinnati:swagger-api-property-fix

Conversation

@davis3tnpolitics

@davis3tnpolitics davis3tnpolitics commented Oct 24, 2025

Copy link
Copy Markdown
Contributor

Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.

Description

This PR fixes the most recent issue raised regarding swagger JSON fields. The change fixes type issues associated with adding swagger annotations to generated validator files.

Changes pass tests and should not include breaking changes.

References

Summary by CodeRabbit

  • Refactor
    • Enhanced validation logic for string array fields in form data handling.
    • Improved API documentation schema generation for JSON field types to ensure accurate specification.

@coderabbitai

coderabbitai Bot commented Oct 24, 2025

Copy link
Copy Markdown

Walkthrough

Ah, elementary indeed! The game reveals itself—modifications to src/helpers.ts introducing conditional logic for string field validation: when dealing with lists, the IsString decorator receives the additional parameter { each: true }. Simultaneously, Swagger metadata for JSON fields undergoes a transformation: the type annotation migrates from string literal "object" to the proper Object type.

Changes

Cohort / File(s) Summary
Validation Decorator Enhancement
src/helpers.ts
Modified IsString decorator application to conditionally append { each: true } argument for array fields; refactored Swagger ApiProperty type annotation from string literal "object" to Object type for JSON fields

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

The modifications are localized to a single file with straightforward, repetitive adjustments to decorator arguments and type annotations. The logic density remains low—primarily parameter mutations and type reassignments. No structural complexity or cross-file dependencies complicate the deduction.

Poem

A string of validation threads, so cleverly bound,
With each: true whispered where arrays are found, 🔍
Object type rises where "object" once stood,
The game's afoot, and the refactor is good!
Small changes, keen eye—the pattern rings true.

Pre-merge checks

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "fixed swagger issues and ran prettier" directly addresses the substantive changes evidenced in the pull request. The swagger alterations are manifest in the raw summary—specifically the type annotation modifications to ApiProperty and the validation adjustments to IsString—which correspond precisely to issue #28's concerns regarding swagger JSON field type problems. The reference to prettier aligns with the documented code formatting objective. The title is neither vague nor misleading; it presents concrete, verifiable actions that appear throughout the changeset. While one might argue it could be more granular in specifying which swagger issues were resolved, the title satisfactorily communicates the primary thrust of the changes to any colleague reviewing the commit history.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f89676c and 6d8f868.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • src/helpers.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Code must be compatible with TypeScript strict mode
Use Prettier for consistent code formatting (npm run format / format:check)

Files:

  • src/helpers.ts
src/**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Place TypeScript source files under src/ (compiled to lib/ via npm run build)

Files:

  • src/helpers.ts
src/helpers.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Provide utilities for decorators, imports, and type mapping in src/helpers.ts

Files:

  • src/helpers.ts
🔇 Additional comments (1)
src/helpers.ts (1)

180-182: Brilliant deduction! The type metamorphosis is precisely what the doctor ordered.

Observe the transformation from string literal "object" to the Object type reference—a most fitting solution for JSON fields, I dare say. The NestJS Swagger decorators expect type: Object for arbitrary object schemas, and your modification ensures the JSON field generates the proper OpenAPI specification.

Comment thread src/helpers.ts
@omar-dulaimi
omar-dulaimi merged commit 3375a8d into omar-dulaimi:master Oct 25, 2025
4 checks passed
@omar-dulaimi

Copy link
Copy Markdown
Owner

Thanks for your contribution!

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.

2 participants