-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
front: fix missing openapi-types in i18n-api-errors script
The openapi-types package is a peerDependency of @apidevtools/swagger-parser. yarn doesn't install peerDependencies by default. This is an issue because when openapi-types is missing, TypeScript doesn't have any typing information about the values returned by SwaggerParser.validate(), and assumes `any`. This results in type checking getting completely disabled for code manipulating the return value. Indeed, after installing openapi-types, `yarn build` indicates TypeScript errors in i18n-api-errors.ts. Fix these errors by checking that the returned schema is OpenAPI (as opposed to Swagger), and that `EditoastError` is a schema object. Signed-off-by: Simon Ser <[email protected]>
- Loading branch information
Showing
3 changed files
with
42 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters