-
Notifications
You must be signed in to change notification settings - Fork 0
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
typescript: Replace scala-tsi with openapi-ts #628
base: master
Are you sure you want to change the base?
Conversation
There was a bug with how the output type of `/audio-api/v1/audios/ids/` were generated. For some reason it is fixed when using an `Array` instead of a `List` as the output. Not sure of the reason, I assume it has to do with the recursive type of `AudioMetaInformationDTO` + `SeriesDTO`, but couldn't get it to work in a satisfying way, so lets just hack around it with `Array` for now.
Maybe we use enums for this maybe??
Since this package has remained unused, i assume it is not needed and we don't want to maintain it if that is the case 😄
This patch replaces the automatic type generation that previously relied on scala-tsi with openapi-ts (https://openapi-ts.dev/) based on automatically generated openapi types from our apis.
Since we hopefully can rely on openapi-ts and our openapi spec instead of scala-tsi, lets remove all the scala-tsi specific code.
6799209
to
795d578
Compare
concept-api/src/main/scala/no/ndla/conceptapi/model/api/UpdatedConceptDTO.scala
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Har ikkje tenkt på at vi ikkje har typer for denne!
@@ -0,0 +1,19 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Veldig pirk, men går det an å få vekk tom linje her?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Det burde være mulig!
Siden jeg føler vi har hatt så mye trøbbel med scalatsi så er dette et forslag på hvordan vi kan generere typer med openapi-ts ut i fra openapi spec'en vår istedenfor.
openapi-ts er ganske mye mer brukt enn scala-tsi så jeg har et lite håp om at vi skal støte på færre gotchas 😄
Lar denne stå som draft-pr frem til jeg har fikset alle typefeilene i frontend'ene siden det er potensielt ting som må endres her frem til det er i orden.
Jeg vet det ser ut som jeg har lagt til 19k linjer, men det er bare autogenerert openapi spec og typescript typer.
(openapi-ts tar med ganske mye mer data og automatisk genererer type for alle endepunktene våre).
Sånn i praksis så er det faktisk ~500 linjer færre med faktisk kode.