Differentiate Task request schemas where different properties are required
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- api
Research direction
Start with the schema changes discussed in pull request 591 and the generated output under src/client. Run yarn generate, then inspect src/tasks/containers/TaskPage.test.tsx around line 259 to understand the current type error. Done means the generated client exposes the differentiated Task request properties while the existing UI tests type-check.
Written by the indexing model from the issue text.
Description
For cloud, a Task must have one of flux or scriptID. If it has scriptID, then it may have other fields (that aren't compatible with flux in a create request).
Differentiating the schemas with oneOf breaks the current UI tests--e.g.:
@jstirnaman
src/tasks/containers/TaskPage.test.tsx:259:66 - error TS2339: Property 'flux' does not exist on type 'TaskCreateRequest | TaskWithScriptCreateRequest'. Property 'flux' does not exist on type 'TaskWithScriptCreateRequest'.
I'm assuming it needs a discriminator to know which schema to use? I ran yarn generate to generate src/client/* locally and I don't even see TaskWithScriptCreateRequest in the results, so I 'm confused.
I'll undo this for now and move it to my someday list. It seems beneficial to clients if they could discern which properties are compatible and required. I hate having it in human-readable-only fields.
Originally posted by @jstirnaman in https://github.com/influxdata/openapi/pull/591#discussion_r1010901842
- Dominant language
- Shell
- Stars
- 18
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from influxdata/openapi
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
influxdata/openapi#657 ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
influxdata/openapi#653 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
influxdata/openapi#240 ·
-
bug
influxdata/openapi#654 · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
influxdata/openapi#636 ·
All issues in influxdata/openapi
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
astral-sh/python-build-standalone#1293 ·
-
package-update
Difficulty 1/5 Under an hour Newbie friendliness 90/100
oSoWoSo/vOid_Community_repOsitory#185 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
carbon-language/carbon-lang#7821 ·