website icon indicating copy to clipboard operation
website copied to clipboard

Format is not only allowed for string values

Open m-mohr opened this issue 6 years ago • 28 comments

At https://json-schema.org/understanding-json-schema/reference/string.html#format it says:

The format keyword allows for basic semantic validation on certain kinds of string values that are commonly used.

As discussed in issue https://github.com/json-schema-org/json-schema-spec/issues/759, format is also defined for non-string types. Therefore, the description should be made more general and moved to another place as it doesn't really fit where it is now. I guess it's better placed at the end of https://json-schema.org/understanding-json-schema/reference/type.html or so...

m-mohr avatar Jul 09 '19 15:07 m-mohr

On one hand, the wording "[the] format keyword allows for basic semantic validation on certain kinds of string values", does not explicitly imply that it can't also be used with other types of values. On the other hand, the fact that the documentation for format only appears alongside reference for the "string" type gives the false impression that it's uniquely for use with strings.

It's also true that the only value for format that are explicitly defined by the spec apply only to string instances, so it still might be helpful to have documentation on pre-defined formats that apply only to strings in the string documentation where it already is; however, more general documentation on "format", and custom formats, could belong elsewhere as you suggest.

Is there a good, real-world example you could point to, of using "format" with another instance type? Maybe the "int32", "int64", etc. example?

embray avatar Jul 24 '19 14:07 embray

@embray https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#dataTypeFormat

handrews avatar Jul 24 '19 17:07 handrews

(although note that their byte and binary formats should actually be handled wth contentEncoding)

handrews avatar Jul 24 '19 17:07 handrews

Thank you--yes, I had seen that posted in another issue but it's good to have here too.

embray avatar Jul 25 '19 10:07 embray

@benjagm can I work on this?

Sanket-0510 avatar Feb 23 '24 21:02 Sanket-0510

@Sanket-0510 Let me check if we can proceed with this one.

benjagm avatar Feb 25 '24 00:02 benjagm

We should either add these changes to #326 or wait until that's merged to work on this.

gregsdennis avatar Feb 25 '24 06:02 gregsdennis

@Sanket-0510 #326 is now merged. You can work on this. Thanks!

benjagm avatar Feb 26 '24 18:02 benjagm

@Sanket-0510 still interested in this issue?

benjagm avatar Mar 02 '24 15:03 benjagm

yes

Sanket-0510 avatar Mar 02 '24 15:03 Sanket-0510

Please go ahead @Sanket-0510 with the usage of the tags described here as used in https://github.com/json-schema-org/website/pull/326.

benjagm avatar Mar 06 '24 00:03 benjagm

Hey @Sanket-0510, Are you still working on this ?

lalitkumawat1m avatar Mar 12 '24 08:03 lalitkumawat1m

Hey @lalitkumawat1m Would love to collaborate on this with you, lets take this issue up together and collaborate?

Kavisha4 avatar Mar 21 '24 04:03 Kavisha4

Hey @Kavisha4 I will definitely do collaborate with you. If @benjagm allows because this issue is already assigned to @Sanket-0510. I'm not sure does he working on this or not.

lalitkumawat1m avatar Mar 21 '24 08:03 lalitkumawat1m

Hey @Kavisha4 I will definitely do collaborate with you. If @benjagm allows because this issue is already assigned to @Sanket-0510. I'm not sure does he working on this or not.

Hey @lalitkumawat1m feel free to take this issue, I have not started to work on this yet.

Sanket-0510 avatar Mar 21 '24 08:03 Sanket-0510

@lalitkumawat1m please go ahead. See this previous comment please.

benjagm avatar Mar 21 '24 09:03 benjagm

Hey @benjagm I would be collaborating with @lalitkumawat1m on this

Kavisha4 avatar Mar 21 '24 09:03 Kavisha4

@lalitkumawat1m are you still working on this issue?

benjagm avatar Apr 11 '24 09:04 benjagm

No, I'm not working on this issue.

lalitkumawat1m avatar Apr 11 '24 10:04 lalitkumawat1m

Thanks Lalit. I am leaving this issue available for other contributors as there has been no progress in weeks.

benjagm avatar Apr 11 '24 10:04 benjagm

Hey There @benjagm. Could I take this issue up? If it's still available?

bhavukkalra avatar Apr 15 '24 08:04 bhavukkalra

Thanks @bhavukkalra . Please go ahead!

benjagm avatar Apr 16 '24 12:04 benjagm

@benjagm assign this issue to me

Hacking-Guru-098 avatar May 27 '24 12:05 Hacking-Guru-098

We are making this issue available to other contributors due to inactivity.

benjagm avatar Jul 24 '24 07:07 benjagm

Hii @benjagm I hope you are doing well , I am Jagpreet Singh , am understand this issue , can u assign me if someone are not able to resolve yet.

jagpreetrahi avatar Sep 21 '24 16:09 jagpreetrahi

@jagpreetrahi thanks for your interest. Please go ahead.

benjagm avatar Sep 23 '24 19:09 benjagm

i want to work on this issue,kindly assign me this issue @benjagm

29deepanshutyagi avatar Oct 06 '24 11:10 29deepanshutyagi

What's the difference between this and #963, which doesn't seem to have an issue listed?

I think this is already being worked.

gregsdennis avatar Oct 06 '24 17:10 gregsdennis