Skip to content

Parameter with a colon in its name generates invalid C# client #4188

@Pilchard123

Description

@Pilchard123

I am trying to generate a client from the OpenAPI document at https://directory.spineservices.nhs.uk/apidocs/ .

Some of the parameters (for example, /STU3/Organization has a parameter address-postalcode:contains ) have names that contain colons. When the client is generated, the parameters in the generated client also have colons in them, making them invalid C#.

I do not have control of the OpenAPI document or the underlying API, so I am unable to change the parameter names.

#2146 seems related, but is about type names, not parameter names.

Is this something that a PR would be accepted for? It looks like it might just be a matter of adding colons to the replacement list in DefaultParameterNameGenerator, though I don't know for certain.

NB: There is an invalid element (tags[1].externalDocs is a [string] but should be an External Documentation object, according to the specification ) that is preventing generation from there. and I have a ticket open with the publisher asking for it to be fixed, but if the document is downloaded and manually edited to correct the error (I just deleted the externalDocs part) then a client can be generated. That is not what I am talking about, since the invalid document does not result in any client (as expected).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions