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

Better interpretation of schema in parameter list #3

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

FabianScheidt
Copy link

In the original implementation types that are referenced using the schema attribute were only recognised if the schema referenced to a class. Otherwise the type would have have been an empty string which caused compiler errors.

I modified to code to support the following definitions:

{
    "in": "body",
    "name": "foo",
    "description": "foo",
    "required": true,
    "schema": {
        "type": "string"
    }
}

and

{
    "in": "body",
    "name": "bar",
    "description": "bar",
    "required": true,
    "schema": {
        "type": "array",
        "items": {
            "$ref": "#/definitions/FooObj"
        }
    }
}

If no type can be found it will also be set to any to avoid compiler errors.

@FabianScheidt
Copy link
Author

I made two more changes:

  • Optional parameters are now marked as optional in the typescript signature
  • OPTIONS and PATCH requests can now also be executed

@FabianScheidt FabianScheidt force-pushed the master branch 5 times, most recently from db29905 to dbd58a4 Compare January 31, 2019 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant