cloudflare / doca

A CLI tool that scaffolds API documentation based on JSON HyperSchemas.
BSD 3-Clause "New" or "Revised" License
228 stars 36 forks source link

link request "required" at LDO level overrides "schema" level #54

Closed handrews closed 7 years ago

handrews commented 7 years ago

We would copy "required" from the LDO level into the parameters object (even if it was undefined), instead of just using the one in "schema".

Posted a PR before filing the issue: cloudflare/json-schema-example-loader#5

@Relequestual (or anyone) were you relying on this? We will bump the version number before publishing this, but I might have some other fixes before then.

Relequestual commented 7 years ago

We are relying on this, yes, but I agree that it doesn't really make sense. Also I found a mistake in our generation code =/

Anyway. It makes sense to use the one found in the LOD schema. Is required even valid at the LOD level (draft-4+)? Doesn't look like it.

handrews commented 7 years ago

Is required even valid at the LDO level (draft-4+)? Doesn't look like it.

Nope. There are a couple of things in json-schema-example-loader that are against the spec, and I'm prioritizing fixing those ASAP. This, the treatment of "additionalProperties", and the nonstandard "rel": "self" in place of "$ref": "#" inside of "schema" and "targetSchema" are the main ones.

Other than that there are things we don't support, but we just ignore them so they are less critical.

handrews commented 7 years ago

This is merged and will be fixed in the next release of json-schema-example-loader. I've marked it as needing a release note when we roll the version. There are several more changes that I want to get all in one release before that happens (basically the ones mentioned in the previous comment).