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

format schema field warning #1597

Closed
sammy-da opened this issue Oct 12, 2022 · 5 comments · Fixed by #1598
Closed

format schema field warning #1597

sammy-da opened this issue Oct 12, 2022 · 5 comments · Fixed by #1598

Comments

@sammy-da
Copy link

sammy-da commented Oct 12, 2022

I have a schema defined like this:

 {
      "type": "string",
      "description": "...",
      "format": "jwt"
}

the sbt build gives me a warning:

Warning: Deprecated behavior: Unsupported format 'jwt' for type 'string', falling back to String. Please switch definitions to x-scala-type for custom types. (.components.schemas.AccountToken)

I tried adding an "x-scala-type": "String", field to the schema, but still getting the same warning.

@blast-hardcheese
Copy link
Member

@sammy-da Hello, please excuse the delay in response.

You're very much correct! We treat x-scala-type preferentially, but still emit the warning, even if that value is never used.

I've just pushed up a fix to resolve this (sorry that merging that closed this issue before I had a chance to comment), I'll be releasing a new version of guardrail-core shortly. If you explicitly depend on that newer version in your project/plugins.sbt it will resolve this issue.

@blast-hardcheese
Copy link
Member

https://github.com/guardrail-dev/guardrail/releases/tag/core-v0.75.3 is released, and

libraryDependencies += "dev.guardrail" %% "guardrail-core" % "0.75.3"

in your project/plugins.sbt should work as soon as the metadata syncs to maven central.

Thank you for the report!

@sammy-da
Copy link
Author

thanks @blast-hardcheese!

I will be able to just get the fix from the sbt-plugin itself at some point, without having to manually specify the guardrail-core dependency, correct?

@blast-hardcheese
Copy link
Member

thanks @blast-hardcheese!

I will be able to just get the fix from the sbt-plugin itself at some point, without having to manually specify the guardrail-core dependency, correct?

Yes, that will eventually be the case, I'm just giving you an option to solve this issue for yourself quicker

@blast-hardcheese
Copy link
Member

@sammy-da sbt-guardrail v0.75.1 has been released, thanks for your patience!

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

Successfully merging a pull request may close this issue.

2 participants