Quantcast
Channel: Mobile - Couchbase Forums
Viewing all articles
Browse latest Browse all 1119

Current Sync Gateway OpenAPI (Swagger) yaml definition contains errors

$
0
0

I encountered errors generating a c# client from the current version of sync-gateway-public.yaml using both AutoRest and NSwagStudio. When I validated the yaml content with https://editor.swagger.io, I can see that several errors were reported (as attached below). After manually fixing those errors on my own copy of the yaml, I was able to at least generate client codes for my project using NSwagStudio. (AutoRest still failed with an error which I didn’t go deeper to find out a solution)

Even though I was able to get past those errors for my purpose, I thought I should report this problem so that the Couchbase team can address them accordingly.

Details about the problem:

  1. Download the yaml from:
    https://docs.couchbase.com/sync-gateway/current/_attachments/sync-gateway-public.yaml
  2. Use AutoRest to generate a client (c# in this case):
    autorest --csharp --output-folder=.\sgclient --input-file=sync-gateway-public.yaml --namespace=myproject --add-credentials
  3. With NSwagStudio, I could generate output but all the operations are named like this: AnonymousXXAsync.

Some errors reported by https://editor.swagger.io and what I did to my own copy of yaml to get rid of the errors:

  1. Changed parameters.since.type from object to string
  2. Fixed several misspelled ‘description’ properties to ‘description’
  3. Added meaningful, unique operationId to all operations
  4. Removed some unsupported properties ‘name’
  5. Added the missing ‘items’ field at additionalProperties.properties.missing

I also found out that the optional property ‘deleted’ is missing from the ChangesFeedRow definition. I think I need to use that to determine the type of a change.

I hope this helps anyone encountering the same issue.
Andy

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 1119

Trending Articles