From a9c4dfc3f1ebb1d4d4a1d6789aa8fedca7679e2c Mon Sep 17 00:00:00 2001 From: AdrianPaez Date: Fri, 22 Feb 2019 11:16:48 -0500 Subject: [PATCH 1/4] Add file AdrianPaez_espec.yml --- AdrianPaez_espec.yml | 65 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 AdrianPaez_espec.yml diff --git a/AdrianPaez_espec.yml b/AdrianPaez_espec.yml new file mode 100644 index 0000000..17f7c3a --- /dev/null +++ b/AdrianPaez_espec.yml @@ -0,0 +1,65 @@ +openapi: 3.0.0 +info: + title: Python to .Net + description: Still whitout description. + version: 0.25.1 +servers: +- url: http://www.skycoin.net + description: Main Skycoin server +- url: http://staging.node.skycoin.net + description: Internal staging server for developer. +components: + securitySchemes: + CsrfTokenAuth: # arbitrary name for the security scheme + type: apiKey + in: header # can be "header", "query" or "cookie" + name: X-CSRF-TOKEN # name of the header, query parameter or cookie + schemas: + genericError: + description: This is a generic error that should be default response + type: object + properties: + code: + type: integer + format: int64 + message: + type: string +paths: + /somePath: + get: + summary: This is a example of a get method. + description: Some description, is not optional. + responses: + '200': # status code + description: A response of arrays + content: + application/json: + schema: + type: array + items: + type: string + default: + $ref : '#/components/genericError' + post: + summary: This is a example of a post method. + description: Some description, is not optional. + + security: + - CsrfTokenAuth: [] + + responses: + '200': # status code + description: A response of arrays + content: + application/json: + schema: + type: array + items: + type: string + default: + $ref : '#/components/genericError' + +# To remember : +# Every post method should use security schema. +# Feel free to use and reuse components +# I will remember other stuffs in the process \ No newline at end of file From fc19ab51a3f04275f3915a8cd52f08c2521ca8ef Mon Sep 17 00:00:00 2001 From: AdrianPaez Date: Fri, 22 Feb 2019 12:42:39 -0500 Subject: [PATCH 2/4] Set endpoint spec --- AdrianPaez_espec.yml | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/AdrianPaez_espec.yml b/AdrianPaez_espec.yml index 17f7c3a..29664ce 100644 --- a/AdrianPaez_espec.yml +++ b/AdrianPaez_espec.yml @@ -25,39 +25,28 @@ components: message: type: string paths: - /somePath: - get: - summary: This is a example of a get method. - description: Some description, is not optional. - responses: - '200': # status code - description: A response of arrays - content: - application/json: - schema: - type: array - items: - type: string - default: - $ref : '#/components/genericError' + /api/wallets: post: - summary: This is a example of a post method. - description: Some description, is not optional. + summary: Create wallet method. + description: Should create a new wallet (address) in the blockchain. security: - CsrfTokenAuth: [] responses: - '200': # status code - description: A response of arrays + '200': + description: Private key, wich will be used to sign transactions by the [POST] /api/sign. Address wich identifies the wallet in the blockchain. content: application/json: schema: - type: array - items: - type: string + type: object + properties: + privateKey: + type: string + publicAddress: + type: string default: - $ref : '#/components/genericError' + $ref : '#/components/schemas/genericError' # To remember : # Every post method should use security schema. From a1206847ecb002b715a051796463d04af554d368 Mon Sep 17 00:00:00 2001 From: AdrianPaez Date: Mon, 25 Feb 2019 13:06:25 -0500 Subject: [PATCH 3/4] Add addressContext to spec --- AdrianPaez_espec.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/AdrianPaez_espec.yml b/AdrianPaez_espec.yml index 29664ce..f2d226a 100644 --- a/AdrianPaez_espec.yml +++ b/AdrianPaez_espec.yml @@ -45,6 +45,8 @@ paths: type: string publicAddress: type: string + addressContext: + type: string default: $ref : '#/components/schemas/genericError' From 99b999bbe7c28c7ef98f6b3ae046142eb33546c2 Mon Sep 17 00:00:00 2001 From: AdrianPaez Date: Mon, 25 Feb 2019 13:37:50 -0500 Subject: [PATCH 4/4] Make better descritptions --- AdrianPaez_espec.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/AdrianPaez_espec.yml b/AdrianPaez_espec.yml index f2d226a..ada3fa0 100644 --- a/AdrianPaez_espec.yml +++ b/AdrianPaez_espec.yml @@ -35,17 +35,20 @@ paths: responses: '200': - description: Private key, wich will be used to sign transactions by the [POST] /api/sign. Address wich identifies the wallet in the blockchain. + description: Should create a new wallet (address) in the blockchain content: application/json: schema: type: object properties: privateKey: + description: Private key, which will be used to sign transactions by the [POST] /api/sign type: string publicAddress: + description: Address which identifies the wallet in the blockchain type: string addressContext: + description: Any non security sensitive data associated with wallet. This context will be passed to [POST] /api/transactions/*. Can be empty. type: string default: $ref : '#/components/schemas/genericError'