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

feat(hono): add orverride.hono.validatorOutputPath option #1811

Conversation

soartec-lab
Copy link
Member

@soartec-lab soartec-lab commented Jan 13, 2025

Status

READY

Description

Until now, validator.ts was output to the same directory as other files output to target.
In fact, validator.ts is only referenced in handlers, so I want to output it to the same hierarchy instead of target.
So I added an option to give me control over it.

Before:

src/
├── endpoints.context.ts
├── endpoints.ts
├── endpoints.validator.ts  <--- They are grouped under `target`
├── endpoints.zod.ts
└── handlers

After:

src/
├── endpoints.context.ts
├── endpoints.ts
├── endpoints.zod.ts
└── handlers
    ├── createPets.ts
    ├── deletePetById.ts
    ├── healthCheck.ts
    ├── listPets.ts
    ├── schemas
    ├── showPetById.ts
    └── validator.ts  <--- By specifying the path, output will be under handlers.

Related PRs

None

Todos

The hono client hasn't yet been tests and docs, so I will add those in a separate PR.

  • Tests
  • Documentation
  • Changelog Entry (unreleased)

Steps to Test or Reproduce

export default defineConfig({
  petstoreSplitValidatorOutputPath: {
    input: '../specifications/petstore.yaml',
    output: {
      target: '../generated/hono/petstore-split-validator-output-path/endpoints.ts',
      schemas: '../generated/hono/petstore-split-validator-output-path/handlers/schemas',
      mode: 'split',
      client: 'hono',
      override: {
        hono: {
          handlers: '../generated/hono/petstore-split-validator-output-path/handlers',
          validatorOutputPath: '../generated/hono/petstore-split-validator-output-path/handlers/validator.ts',
        },
      },
    },
  },
});

@soartec-lab soartec-lab changed the title feat(hono): add hono.validator option feat(hono): add orverride.hono.validatorOutputPath option Jan 13, 2025
@soartec-lab soartec-lab marked this pull request as ready for review January 13, 2025 08:09
@soartec-lab soartec-lab added enhancement New feature or request hono Hono related issue labels Jan 13, 2025
@soartec-lab
Copy link
Member Author

I'll merge it.

@soartec-lab soartec-lab merged commit fe47c7d into orval-labs:master Jan 15, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hono Hono related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants