Skip to content

Commit 9e40d37

Browse files
author
Pedro Crespo
committed
Merge remote-tracking branch 'upstream/master'
2 parents 65f510c + 0b60f46 commit 9e40d37

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1003
-249
lines changed

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Order is important. The last matching pattern has the most precedence.
22

33
# files and folders recursively
4+
/api/ @sanderegg, @pcrespov
45
/docs/ @pcrespov
56
/services/computation @mguidon
67
/services/dy* @sanderegg

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ matrix:
4646
- pip3 install packages/director-sdk/python
4747
- pushd services/web/server; pip3 install -r requirements/ci.txt; popd
4848
- pushd services/storage; pip3 install -r requirements/dev.txt; popd
49-
- pip3 install -r apis/tests/requirements.txt
49+
- pip3 install -r api/tests/requirements.txt
5050
- pip3 install -r services/apihub/tests/requirements.txt
5151

5252
before_script:

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ before_test:
9696
${DOCKER_COMPOSE} -f packages/simcore-sdk/tests/docker-compose.yml build
9797

9898
run_test:
99-
pytest -v apis/tests
99+
pytest -v api/tests
100100
pytest -v services/apihub/tests
101101
pytest --cov=pytest_docker -v packages/pytest_docker/tests
102102
pytest --cov=s3wrapper -v packages/s3wrapper/tests

apis/README.md renamed to api/README.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ The oSparc platform uses the following standards:
1515
## Folder structure
1616

1717
```bash
18-
/apis/ # base folder
19-
/apis/director/ # service name folder (e.g. for director service)
20-
/apis/director/v0/ # service version (v0 for development, then v1, v2... only major)
21-
/apis/director/v0/openapi.yaml # openapi specifications in YAML
22-
/apis/director/v0/schemas/ # schemas only used by the director API
23-
/apis/director/v0/schemas/services.yaml # openapi encoded service only schema
24-
25-
/apis/shared/ # shared apis/schemas base folder
26-
/apis/shared/schemas/ # sub folder for schemas
27-
/apis/shared/schemas/health_check.yaml # openapi encoded shared schema
28-
/apis/shared/schemas/node-meta.json # jsonschema encoded shared schema
29-
/apis/shared/schemas/v1/error.yaml # openapi encoded shaared schema for version 1
30-
/apis/shared/schemas/v2/error.yaml # openapi encoded shaared schema for version 2
18+
/api/specs/ # base folder
19+
/api/specs/director/ # service name folder (e.g. for director service)
20+
/api/specs/director/v0/ # service version (v0 for development, then v1, v2... only major)
21+
/api/specs/director/v0/openapi.yaml # openapi specifications in YAML
22+
/api/specs/director/v0/schemas/ # schemas only used by the director API
23+
/api/specs/director/v0/schemas/services.yaml # openapi encoded service only schema
24+
25+
/api/specs/shared/ # shared api/specs/schemas base folder
26+
/api/specs/shared/schemas/ # sub folder for schemas
27+
/api/specs/shared/schemas/health_check.yaml # openapi encoded shared schema
28+
/api/specs/shared/schemas/node-meta.json # jsonschema encoded shared schema
29+
/api/specs/shared/schemas/v1/error.yaml # openapi encoded shaared schema for version 1
30+
/api/specs/shared/schemas/v2/error.yaml # openapi encoded shaared schema for version 2
3131

3232
/tests/ # python tests folder to check schemas validity
3333
/tests/requirements.txt # requirements for python tests
File renamed without changes.
File renamed without changes.

apis/shared/schemas/node-output-list-api-v0.0.1.yaml renamed to api/specs/shared/schemas/node-output-list-api-v0.0.1.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
$schema: http://json-schema.org/draft-07/schema#
2-
$id: https://simcore.io/apis/shared/schemas/node-output-list-api-v0.0.1.yaml
2+
$id: https://simcore.io/api/specs/shared/schemas/node-output-list-api-v0.0.1.yaml
33

44
title: node output list api
55
description: nodes using the list representation for the output
66
must be able to handle the following requests
77
type: object
8-
required:
8+
required:
99
# the validator does not appreciate when required is missing here... and
1010
# sadly does not throw any meaningful error about it... so for now I put this...
1111
- getItemList
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
ErrorEnveloped:
2+
# - notice that data is defaulted to null
3+
#
4+
type: object
5+
required:
6+
- data
7+
- error
8+
properties:
9+
data:
10+
nullable: true
11+
default: null
12+
error:
13+
$ref: "#/ErrorType"
14+
15+
16+
17+
ErrorType:
18+
# - Normally transmitted as a response from server to client
19+
# - can exchage log messages between server and client. Possible applications:
20+
# - e.g. client side can render a widget to display messages logged to 'user'
21+
# - contains meta-information to allow client programatically understand the error. Possible applications:
22+
# - e.g. metadata can serialize an exception in server that can be reproduced in client side
23+
#
24+
type: object
25+
properties:
26+
logs:
27+
description: log messages
28+
type: array
29+
items:
30+
$ref: './log_message.yaml#/LogMessageType'
31+
errors:
32+
description: errors metadata
33+
type: array
34+
items:
35+
$ref: '#/ErrorItemType'
36+
status:
37+
description: HTTP error code
38+
type: integer
39+
example:
40+
BadRequestError:
41+
logs:
42+
- message: 'Requested information is incomplete or malformed'
43+
level: ERROR
44+
- message: 'Invalid email and password'
45+
level: ERROR
46+
logger: USER
47+
errors:
48+
- code: "InvalidEmail"
49+
message: "Email is malformed"
50+
field: email
51+
- code: "UnsavePassword"
52+
message: "Password is not secure"
53+
field: pasword
54+
status: 400
55+
56+
57+
ErrorItemType:
58+
type: object
59+
required:
60+
- code
61+
- message
62+
properties:
63+
code:
64+
type: string
65+
description: Typically the name of the exception that produced it otherwise some known error code
66+
message:
67+
type: string
68+
description: Error message specific to this item
69+
resource:
70+
type: string
71+
description: API resource affected by this error
72+
field:
73+
type: string
74+
description: Specific field within the resource
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
FakeEnveloped:
2+
type: object
3+
required:
4+
- data
5+
- error
6+
properties:
7+
data:
8+
$ref: '#/FakeType'
9+
nullable: true
10+
default: null
11+
error:
12+
$ref: "./error.yaml#/ErrorType"
13+
nullable: true
14+
default: null
15+
16+
FakeType:
17+
type: object
18+
required:
19+
- path_value
20+
- query_value
21+
- body_value
22+
properties:
23+
path_value:
24+
type: string
25+
query_value:
26+
type: string
27+
body_value:
28+
type: object
29+
additionalProperties:
30+
type: string
31+
example:
32+
path_value: foo
33+
query_value: bar
34+
body_value:
35+
key1: value1
36+
key2: value2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
HealthCheckEnveloped:
2+
type: object
3+
required:
4+
- data
5+
- error
6+
properties:
7+
data:
8+
$ref: '#/HealthCheckType'
9+
nullable: true
10+
default: null
11+
error:
12+
$ref: "./error.yaml#/ErrorType"
13+
nullable: true
14+
default: null
15+
16+
17+
HealthCheckType:
18+
type: object
19+
properties:
20+
name:
21+
type: string
22+
status:
23+
type: string
24+
api_version:
25+
type: string
26+
version:
27+
type: string
28+
example:
29+
name: 'simcore-director-service'
30+
status: SERVICE_RUNNING
31+
api_version: 0.1.0-dev+NJuzzD9S
32+
version: 0.1.0-dev+N127Mfv9H
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
LogMessageEnveloped:
2+
type: object
3+
required:
4+
- data
5+
- error
6+
properties:
7+
data:
8+
$ref: "#/LogMessageType"
9+
nullable: true
10+
default: null
11+
error:
12+
$ref: "./error.yaml#/ErrorType"
13+
nullable: true
14+
default: null
15+
16+
17+
LogMessageType:
18+
# - logger can be use as a way for the client to filter messages.
19+
# - E.g. logger naming can be hierarchical, and all including "*.user.*"
20+
# are displayed as a flash message in the front-end
21+
#
22+
type: object
23+
properties:
24+
level:
25+
description: log level
26+
type: string
27+
default: INFO
28+
enum:
29+
- DEBUG
30+
- WARNING
31+
- INFO
32+
- ERROR
33+
message:
34+
description: log message. If logger is USER, then it MUST be human readable
35+
type: string
36+
logger:
37+
description: name of the logger receiving this message
38+
type: string
39+
required:
40+
- message
41+
example:
42+
message: 'Hi there, Mr user'
43+
level: INFO
44+
logger: user-logger
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
LoginEnveloped:
2+
type: object
3+
required:
4+
- data
5+
- error
6+
properties:
7+
data:
8+
$ref: '#/LoginFormType'
9+
nullable: true
10+
default: null
11+
error:
12+
$ref: "./error.yaml#/ErrorType"
13+
nullable: true
14+
default: null
15+
16+
17+
LoginFormType:
18+
type: object
19+
properties:
20+
email:
21+
type: string
22+
#FIXME: format: email
23+
password:
24+
type: string
25+
#FIXME: format: password
26+
example:
27+
28+
password: 'my secret'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
RegistrationEnveloped:
2+
type: object
3+
required:
4+
- data
5+
- error
6+
properties:
7+
data:
8+
$ref: '#/RegistrationType'
9+
nullable: true
10+
default: null
11+
error:
12+
$ref: "./error.yaml#/ErrorType"
13+
nullable: true
14+
default: null
15+
16+
17+
RegistrationType:
18+
type: object
19+
properties:
20+
email:
21+
type: string
22+
#FIXME: 'error': {'logs': [], 'errors': [{'code': 'OpenAPISchemaError', 'message': 'Unsupported email format unmarshalling', 'resource': None, 'field': None}], 'status': 400}}
23+
#format: email
24+
password:
25+
type: string
26+
# TODO: File "/home/crespo/devp/osparc-simcore/.venv/lib/python3.6/site-packages/openapi_core/schema/schemas/models.py", line 182, in _unmarshal_string
27+
# formatter = self.STRING_FORMAT_CAST_CALLABLE_GETTER[schema_format]
28+
# KeyError: <SchemaFormat.PASSWORD: 'password'>
29+
#format: password
30+
confirm:
31+
type: string
32+
#format: password
33+
example:
34+
35+
password: 'my secret'
36+
confim: 'my secret'

0 commit comments

Comments
 (0)