Skip to content
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

schema compliance with jsr #493

Closed
wendrul opened this issue Apr 25, 2024 · 3 comments
Closed

schema compliance with jsr #493

wendrul opened this issue Apr 25, 2024 · 3 comments
Labels
feature 🚀 New feature or request

Comments

@wendrul
Copy link

wendrul commented Apr 25, 2024

Description

Similar to #492 when generating schemas through openapi-ts, the jsr publish command complains as such:

$ npx jsr publis --dry-run

error[missing-explicit-type]: missing explicit type in the public API
   --> /home/wendrul/windmill-dev/jsr/typescript-client/src/schemas.gen.ts:543:14
    |
543 | export const $MySchema = {
    |              ^^^^^^^^^^^^^ this symbol is missing an explicit type
    = hint: add an explicit type annotation to the symbol

  info: all symbols in the public API must have an explicit type
  docs: https://jsr.io/go/slow-type-missing-explicit-type

as these are consts, we found that copying and pasting the value as a type is enough to make the error go away.

Generating schemas with explicit types is a (most likely) simple change that would help openapi-ts generated clients to be easily published and integrated to jsr.

more about jsr: https://jsr.io/#why-jsr

@wendrul wendrul added the feature 🚀 New feature or request label Apr 25, 2024
@mrlubos
Copy link
Member

mrlubos commented Apr 25, 2024

Hey @wendrul can you open a discussion at JSR and tag me in there too? I don't think it's right that we should be generating types for schemas. There's no mention of constants on that link either, only functions and classes.

@wendrul
Copy link
Author

wendrul commented Apr 25, 2024

Will do, and yeah we were also a little confused about why this applied to const

@wendrul
Copy link
Author

wendrul commented Apr 28, 2024

This turned out to be a bug in jsr. Backtick delimited string literals were marked as tagged template literals, flagging them as slow types.
jsr-io/jsr#447 (reply in thread)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🚀 New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants