splitwise / api-docs

API documentation for the Splitwise API.
http://dev.splitwise.com
28 stars 16 forks source link

Spec semantic errors #58

Closed pkoch closed 2 years ago

pkoch commented 2 years ago

Hi!

I was poking around with the API to make my own app, and I tried to auto-generate a client from it with Restish. After configuring it to use the schema file you make available on https://dev.splitwise.com/, it was complaining about a few obvious and minor errors (like still mentioning yaml files instead of entities).

However, even after correcting the obvious lapses, it refused to work. When I pasted my fixed version of the schema to https://editor.swagger.io/, it does show a bunch of semantic errors. Here's what I see:

Semantic error at paths./undelete_group/{id}.post.responses.200.content.application/json.schema.properties.errors
Schemas with 'type: array', require a sibling 'items: ' field

Semantic error at paths./add_user_to_group.post.responses.200.content.application/json.schema.properties.errors.additionalProperties
Schemas with 'type: array', require a sibling 'items: ' field

Semantic error at paths./remove_user_from_group.post.responses.200.content.application/json.schema.properties.errors.additionalProperties
Schemas with 'type: array', require a sibling 'items: ' field

Semantic error at paths./create_friends.post.responses.200.content.application/json.schema.properties.errors
Schemas with 'type: array', require a sibling 'items: ' field

Semantic error at paths./create_friends.post.responses.400.content.application/json.schema.properties.users
Schemas with 'type: array', require a sibling 'items: ' field

Semantic error at paths./create_friends.post.responses.400.content.application/json.schema.properties.errors.additionalProperties
Schemas with 'type: array', require a sibling 'items: ' field

Structural error at paths./create_friends.post.responses.400.content.example
should NOT have additional properties
additionalProperty: users, errors

Semantic error at paths./delete_friend/{id}.post.responses.200.content.application/json.schema.properties.errors.additionalProperties
Schemas with 'type: array', require a sibling 'items: ' field

Structural error at paths./update_expense/{id}
should NOT have additional properties
additionalProperty: params

Semantic error at paths./update_expense/{id}
Declared path parameter "id" needs to be defined as a path parameter at either the path or operation level

Structural error at paths./delete_expense/{id}
should NOT have additional properties
additionalProperty: params

Semantic error at paths./delete_expense/{id}
Declared path parameter "id" needs to be defined as a path parameter at either the path or operation level

Structural error at paths./delete_expense/{id}.post.responses.200
should have required property 'description'
missingProperty: description

Structural error at paths./delete_expense/{id}.post.responses.200.content.application/json.schema.properties.success.required
should be an array of property names required within an object schema

Structural error at paths./undelete_expense/{id}
should NOT have additional properties
additionalProperty: params

Semantic error at paths./undelete_expense/{id}
Declared path parameter "id" needs to be defined as a path parameter at either the path or operation level

Structural error at paths./undelete_expense/{id}.post.responses.200
should have required property 'description'
missingProperty: description

Structural error at paths./delete_comment.post
should NOT have additional properties
additionalProperty: params

Structural error at paths./parse_sentence.post.requestBody.content.application/json.schema.oneOf.0.properties.input.required
should be an array of property names required within an object schema

Structural error at paths./parse_sentence.post.requestBody.content.application/json.schema.oneOf.1.properties.input.required
should be an array of property names required within an object schema

Structural error at paths./parse_sentence.post.requestBody.content.application/json.schema.oneOf.2.properties.input.required
should be an array of property names required within an object schema

Semantic error at components.responses.Not Found
Component names can only contain the characters A-Z a-z 0-9 - . _

The schema file ended up being just enough docs for me to understand what curls I wanted to make, but I feel it's probably worth the time to make the file error-free.

jas14 commented 2 years ago

Closed by #63