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

Add support for kebab-string-casing parameters #11

Merged
merged 5 commits into from
Mar 22, 2023
Merged

Conversation

christianhelle
Copy link
Owner

The changes here fix the missing support for using kebab-string-casing in path parameters

The following OpenAPI spec:

openapi: "3.0.0"
info:
  version: "v1"
  title: "Test API"
servers:
  - url: "https://test.host.com/api/v1"
paths:
  /jobs/{job-id}:
    get:
      tags:
      - "Jobs"
      summary: "Get job details"
      description: "Get the details of the specified job."
      parameters:
        - in: "path"
          name: "job-id"
          description: "Job ID"
          required: true
          schema:
            type: "string"
      responses:
        "200":
          description: "successful operation"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/JobResponse"
components:
  schemas:
    JobResponse:
      type: "object"
      properties:
        job:
          type: "object"
          properties:
            start-date:
              type: "string"
              format: "date-time"
            details:
              type: "string"

Generates the following code:

/// <summary>
/// Get the details of the specified job.
/// </summary>
[Get("/jobs/{jobId}")]
Task<JobResponse> Jobs(string jobId);

This resolves #10 reported by @m7clarke

@christianhelle christianhelle added the bug Something isn't working label Mar 22, 2023
@christianhelle christianhelle self-assigned this Mar 22, 2023
@christianhelle christianhelle merged commit 59f8d2b into main Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Please add support for kebab string casing parameters
1 participant