Skip to content
This repository was archived by the owner on Nov 2, 2023. It is now read-only.

Update example name #70

Closed
fulldecent opened this issue Jan 18, 2017 · 6 comments
Closed

Update example name #70

fulldecent opened this issue Jan 18, 2017 · 6 comments

Comments

@fulldecent
Copy link
Contributor

fulldecent commented Jan 18, 2017

This regards examples.html and perhaps other examples.

I am just starting to learn about JSON Schema and read the first example:

{
	"title": "Example Schema",
	"type": "object",
	"properties": {
		"firstName": {
			"type": "string"
		},
		"lastName": {
			"type": "string"
		},
		"age": {
			"description": "Age in years",
			"type": "integer",
			"minimum": 0
		}
	},
	"required": ["firstName", "lastName"]
}

The title attribute is defined in http://json-schema.org/latest/json-schema-validation.html#rfc.section.6.1 as:

[This keyword] can be used to decorate a user interface with information about the data produced by this user interface.

In light of this, the example's title seems incorrect because it is describing the schema itself rather than the JSON instance that is being validated.

Recommended change:

"title": "Person",
@fulldecent
Copy link
Contributor Author

fulldecent commented Jan 18, 2017

Per git grep '"title": "' | cat following are all places to consider an update:

  • draft-04/hyper-schema: "title": "JSON Hyper-Schema",
  • draft-04/hyper-schema: "title": "Link Description Object",
  • draft-04/links: "title": "Link Description Object",
  • draft-zyp-json-schema-03.xml: "title": "Product",
  • draft-zyp-json-schema-04.xml: "title": "Product",
  • example1.html: "title": "Product",
  • example1.html: "title": "Product",
  • example1.html: "title": "Product",
  • example1.html: "title": "Product",
  • example1.html: "title": "Product",
  • example1.html: "title": "Product set",
  • example1.html: "title": "Product",
  • examples.html: "title": "Example Schema", see Use descriptive title in example, fixes #70 #71
  • hyper-schema: "title": "JSON Hyper-Schema",
  • hyper-schema: "title": "Link Description Object",
  • latest/json-schema-core.html: "title": "root", NOT GOOD
  • latest/json-schema-core.html: "title": "array item" NOT GOOD
  • latest/json-schema-hypermedia.html: "title": "Written Article",
  • latest/json-schema-hypermedia.html: "title": "Article Identifier",
  • latest/json-schema-hypermedia.html: "title": "Article Title",
  • latest/json-schema-hypermedia.html: "title": "Article Illustration (thumbnail)",
  • latest/json-schema-hypermedia.html: "title": "Example data",
  • latest/json-schema-hypermedia.html: "title": "Schema defining links",
  • links: "title": "Link Description Object",

I am checking off each one that is reviewed as correct.

@fulldecent
Copy link
Contributor Author

Pull request #71 fixes the first issue. Nearly everything else is OK.

Perhaps this example could also be more descriptive: https://github.com/json-schema-org/json-schema-org.github.io/blob/master/latest/json-schema-core.html#L590-L596

{
    "title": "root",
    "items": {
        "title": "array item"
    }
}

@handrews
Copy link
Contributor

@fulldecent see
json-schema-org/json-schema-spec#136 (general discussion of documetation keywords)
json-schema-org/json-schema-spec#197 (propossed "$coment" to prevent people from using "title" as a comment)

I feel like there are some more issues along these lines but I can't find them right now (there are several regarding default, but fewer regarding title and description).

Basically, there's not agreement on what these keywords are really for. Some current project members regularly quote definitions that do not agree with the spec. I'm hoping we can address this soon after we get Draft 06 out the door.

For now I would call this blocked on the general confusion over what we are doing with annotation/documentation/comments.

@Relequestual
Copy link
Member

@fulldecent Really appreciate your effort on this. I'm not as reserved as @handrews on this one, but if he says we should wait, then we should.

Relequestual added a commit that referenced this issue Feb 23, 2017
Use descriptive title in example, fixes #70
@Relequestual Relequestual reopened this Feb 23, 2017
@fulldecent
Copy link
Contributor Author

Thank you. Next PR coming to fix the remaining one.

@fulldecent
Copy link
Contributor Author

Done. That is the last remaining one.

Relequestual added a commit that referenced this issue Mar 6, 2017
Use descriptive title in example, fixes #70
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants