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

Please add support for kebab string casing parameters #10

Closed
m7clarke opened this issue Mar 22, 2023 · 4 comments · Fixed by #11
Closed

Please add support for kebab string casing parameters #10

m7clarke opened this issue Mar 22, 2023 · 4 comments · Fixed by #11
Assignees
Labels
bug Something isn't working enhancement New feature, bug fix, or request

Comments

@m7clarke
Copy link

I found Refitter didn't generate valid C# output with kebab string casing parameters.
See job-id in this sample OpenAPI 3.0 file:

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"

Invalid C# parameter output snippet:

        [Get("/jobs/{job-id}")]
        Task<JobResponse> Jobs(string job-id);
@christianhelle christianhelle self-assigned this Mar 22, 2023
@christianhelle christianhelle added the bug Something isn't working label Mar 22, 2023
@christianhelle
Copy link
Owner

@m7clarke thanks for taking the time to report this

This should be trivial to fix so I'll work on this immediately

@christianhelle
Copy link
Owner

Does this look ok to you @m7clarke

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

@christianhelle
Copy link
Owner

christianhelle commented Mar 22, 2023

This is now fixed and released to nuget.org as version 0.3.4

@m7clarke
Copy link
Author

Does this look ok to you @m7clarke

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

Excellent work, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature, bug fix, or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants