Closed markm77 closed 3 years ago
The problem about the duplicate error is your apis don't define an operationId
and it defaults to using the tags but as you have multiple api with the same tags, it fails.
You can see those warnings in the output:
WARNING (Interpretations): Generating 'operationId' for 'post' operation on path '/register'
WARNING (Interpretations): Generating 'operationId' for 'delete' operation on path '/register/{ClientId}'
The warning should probably include what generated id to make it obvious, I'll look into that
Thanks @timotheeguerin for the comment.
I have tried again using variants of below config with latest C# beta from Nuget (3.0.0-beta.20201217.1).
Should the "directive" below solve the operationId issue you refer to?
Also do you have any info why "csharp" section leads to "Cannot resolve pipeline stage 'openapi-document/identity'"?
Many thanks for any help.
input-file:
- https://github.com/OpenBankingUK/client-registration-api-specs/blob/e211e5eef8b9dfd907760b42723c31632a226e1d/dist/client-registration-openapi.yaml
csharp:
namespace: FinnovationLabs.OpenBanking.Library.Connector.ObModels.ClientRegistration.V3p2
use-datetimeoffset: true
output-folder: .
directive:
- from: openapi-document # do it globally
where: $.paths.*.*
transform: $.operationId = `OBC2_${$.tags[0]}`
Update: I guess the fact registration endpoints have the same first tag ("Client Registration") will create a problem with OBC2_${$.tags[0]}
so is there another suggested transform I could use to get unique operation IDs?
I tested V3 AutoRest and the V3 C# generator as described here.
I was trying to process this relatively simple public Open API file as a test.
You can see the problems I had in that post and the comments that follow.
Problem 1: the generator fails with
csharp
options in autorest.mdProblem 2: Code generation fails due to multiple optional endpoints (three of them)
Problem 3: Code generation fails due to a claimed duplicate RegistrationError (but a simple text inspection of the file shows there is only one).
Can anyone help?