Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apify-api/openapi/components/schemas/actors/Actor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ properties:
example: My favourite actor!
restartOnError:
type: boolean
nullable: true
example: false
deprecated: true # Use defaultRunOptions.restartOnError instead
isPublic:
type: boolean
example: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ properties:
example: My actor is the best
restartOnError:
type: boolean
nullable: true
example: false
deprecated: true # Use defaultRunOptions.restartOnError instead
versions:
type: array
items:
Expand All @@ -46,6 +46,4 @@ properties:
description: ''
nullable: true
defaultRunOptions:
oneOf:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: @B4nan, why do we declare the nullable fields in some cases like this ?
It results in a bit weird notation in docs, see screenshot.

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no idea, the openapi schema was generated from apiary some time ago, could have been a quirk in the conversion script

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the actual type accepted by the API? Is it "DefaultRunOptions or null"?

I'm asking so that I can check out if there's a better way to express this. But you're right that this looks suspicious.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question ... it actually is not nullable, as setting DefaultRunOptions to null will fail both creation and update of the Actor.

So it case of update and create schema, it should be only optional, but not nullable 🤔
I guess not listing it in required but not setting it as nullable should be good enough.

Will try later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Now it should better reflect the behaviour of the API.

Side note: I'm planning to revisit the DefaultRunOptions and make API accept partial DefaultRunOptions, so that user can specify only the defaults they actually want to customize and get our internal defaults for the rest.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! Thanks for investigating 🙂

- nullable: true
- $ref: ./DefaultRunOptions.yaml
$ref: ./DefaultRunOptions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ properties:
memoryMbytes:
type: number
example: 2048
restartOnError:
type: boolean
example: false
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
title: ActUpdate
required:
- name
- isPublic
- versions
type: object
properties:
name:
Expand All @@ -29,8 +25,8 @@ properties:
example: My Actor
restartOnError:
type: boolean
nullable: true
example: false
deprecated: true # Use defaultRunOptions.restartOnError instead
versions:
type: array
items:
Expand All @@ -47,9 +43,7 @@ properties:
description: ''
nullable: true
defaultRunOptions:
oneOf:
- nullable: true
- $ref: ./DefaultRunOptions.yaml
$ref: ./DefaultRunOptions.yaml
taggedBuilds:
type: object
description: |
Expand All @@ -71,3 +65,7 @@ properties:
example:
latest:
buildId: z2EryhbfhgSyqj6Hn
required:
- name
- isPublic
- versions
4 changes: 2 additions & 2 deletions apify-api/openapi/paths/actors/acts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ post:
isPublic: false
seoTitle: My Actor
seoDescription: My Actor is the best
restartOnError: false
versions:
- versionNumber: '0.0'
sourceType: SOURCE_FILES
Expand All @@ -161,6 +160,7 @@ post:
build: latest
timeoutSecs: 3600
memoryMbytes: 2048
restartOnError: false
required: true
responses:
'201':
Expand All @@ -183,7 +183,6 @@ post:
name: MyActor
username: jane35
description: My favourite Actor!
restartOnError: false
isPublic: false
createdAt: '2019-07-08T11:27:57.401Z'
modifiedAt: '2019-07-08T14:01:05.546Z'
Expand Down Expand Up @@ -225,6 +224,7 @@ post:
build: latest
timeoutSecs: 3600
memoryMbytes: 2048
restartOnError: false
exampleRunInput:
body: '{ "helloWorld": 123 }'
contentType: application/json; charset=utf-8
Expand Down
6 changes: 3 additions & 3 deletions apify-api/openapi/paths/actors/acts@{actorId}.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ get:
name: MyActor
username: jane35
description: My favourite Actor!
restartOnError: false
isPublic: false
createdAt: '2019-07-08T11:27:57.401Z'
modifiedAt: '2019-07-08T14:01:05.546Z'
Expand Down Expand Up @@ -70,6 +69,7 @@ get:
build: latest
timeoutSecs: 3600
memoryMbytes: 2048
restartOnError: false
exampleRunInput:
body: '{ "helloWorld": 123 }'
contentType: application/json; charset=utf-8
Expand Down Expand Up @@ -140,7 +140,6 @@ put:
seoTitle: My Actor
seoDescription: My Actor is the best
title: My Actor
restartOnError: false
versions:
- versionNumber: '0.0'
sourceType: SOURCE_FILES
Expand All @@ -159,6 +158,7 @@ put:
build: latest
timeoutSecs: 3600
memoryMbytes: 2048
restartOnError: false
required: true
responses:
'200':
Expand All @@ -175,7 +175,6 @@ put:
name: MyActor
username: jane35
description: My favourite Actor!
restartOnError: false
isPublic: false
createdAt: '2019-07-08T11:27:57.401Z'
modifiedAt: '2019-07-08T14:01:05.546Z'
Expand Down Expand Up @@ -217,6 +216,7 @@ put:
build: latest
timeoutSecs: 3600
memoryMbytes: 2048
restartOnError: false
exampleRunInput:
body: '{ "helloWorld": 123 }'
contentType: application/json; charset=utf-8
Expand Down
Loading