Skip to content

Commit

Permalink
Fix wrong jsdoc links
Browse files Browse the repository at this point in the history
Fixes #67
  • Loading branch information
satazor committed May 2, 2020
1 parent 55bedfe commit 09f0d14
Show file tree
Hide file tree
Showing 8 changed files with 308 additions and 209 deletions.
387 changes: 240 additions & 147 deletions docs/API.md

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions src/ArraySchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ const ArraySchema = ({ schema = initialState, ...options } = {}) => {
* If "items" is an array of schemas, validation succeeds if each element of the instance validates against the schema at the same position, if any.
* Omitting this keyword has the same behavior as an empty schema.
*
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.4.1|reference}
* @param {FluentSchema|FluentSchema[]} items
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.4.1}
* @returns {FluentSchema}
*/

Expand Down Expand Up @@ -66,8 +66,8 @@ const ArraySchema = ({ schema = initialState, ...options } = {}) => {
/**
* This keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself.
*
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.4.2|reference}
* @param {FluentSchema|boolean} items
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.4.2}
* @returns {FluentSchema}
*/

Expand All @@ -94,8 +94,8 @@ const ArraySchema = ({ schema = initialState, ...options } = {}) => {
/**
* An array instance is valid against "contains" if at least one of its elements is valid against the given schema.
*
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.4.6|reference}
* @param {FluentSchema} value
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.4.2}
* @returns {FluentSchema}
*/

Expand All @@ -121,8 +121,8 @@ const ArraySchema = ({ schema = initialState, ...options } = {}) => {
* If it has boolean value true, the instance validates successfully if all of its elements are unique.
* Omitting this keyword has the same behavior as a value of false.
*
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.4.5|reference}
* @param {boolean} boolean
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.4.5}
* @returns {FluentSchema}
*/

Expand All @@ -140,8 +140,8 @@ const ArraySchema = ({ schema = initialState, ...options } = {}) => {
* An array instance is valid against "minItems" if its size is greater than, or equal to, the value of this keyword.
* Omitting this keyword has the same behavior as a value of 0.
*
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.4.4|reference}
* @param {number} min
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.4.4}
* @returns {FluentSchema}
*/

Expand All @@ -155,8 +155,8 @@ const ArraySchema = ({ schema = initialState, ...options } = {}) => {
* An array instance is valid against "minItems" if its size is greater than, or equal to, the value of this keyword.
* Omitting this keyword has the same behavior as a value of 0.
*
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.4.3|reference}
* @param {number} max
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.4.3}
* @returns {FluentSchema}
*/

Expand Down
55 changes: 30 additions & 25 deletions src/BaseSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const BaseSchema = (
/**
* It defines a URI for the schema, and the base URI that other URI references within the schema are resolved against.
*
* {@link https://json-schema.org/latest/json-schema-core.html#id-keyword|reference}
* {@link https://tools.ietf.org/html/draft-handrews-json-schema-01#section-8.2|reference}
* @param {string} id - an #id
* @returns {BaseSchema}
*/
Expand All @@ -54,7 +54,7 @@ const BaseSchema = (
/**
* It can be used to decorate a user interface with information about the data produced by this user interface. A title will preferably be short.
*
* {@link https://json-schema.org/latest/json-schema-validation.html#rfc.section.10.1|reference}
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.10.1|reference}
* @param {string} title
* @returns {BaseSchema}
*/
Expand All @@ -68,7 +68,7 @@ const BaseSchema = (
* produced by this user interface. A description provides explanation about
* the purpose of the instance described by the schema.
*
* {@link https://json-schema.org/latest/json-schema-validation.html#rfc.section.10.1|reference}
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.10.1|reference}
* @param {string} description
* @returns {BaseSchema}
*/
Expand All @@ -84,7 +84,7 @@ const BaseSchema = (
* The value of this keyword MUST be an array.
* There are no restrictions placed on the values within the array.
*
* {@link https://json-schema.org/latest/json-schema-validation.html#rfc.section.10.4|reference}
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.10.4|reference}
* @param {string} examples
* @returns {BaseSchema}
*/
Expand All @@ -111,7 +111,7 @@ const BaseSchema = (
/**
* The value of this keyword MUST be an array. This array SHOULD have at least one element. Elements in the array SHOULD be unique.
*
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.1.2}
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.1.2|reference}
* @param {array} values
* @returns {BaseSchema}
*/
Expand All @@ -127,7 +127,7 @@ const BaseSchema = (
/**
* The value of this keyword MAY be of any type, including null.
*
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.1.3}
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.1.3|reference}
* @param value
* @returns {BaseSchema}
*/
Expand All @@ -139,7 +139,7 @@ const BaseSchema = (
/**
* There are no restrictions placed on the value of this keyword.
*
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#rfc.section.10.2}
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.10.2|reference}
* @param defaults
* @returns {BaseSchema}
*/
Expand All @@ -150,9 +150,9 @@ const BaseSchema = (

/**
* The value of readOnly can be left empty to indicate the property is readOnly.
* It takes an optional boolean which can be used to explicitly set readOnly true/false
* It takes an optional boolean which can be used to explicitly set readOnly true/false.
*
* {@link readOnly|https://json-schema.org/latest/json-schema-validation.html#rfc.section.10.3}
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.10.3|reference}
* @param {boolean|undefined} isReadOnly
* @returns {BaseSchema}
*/
Expand All @@ -164,9 +164,9 @@ const BaseSchema = (

/**
* The value of writeOnly can be left empty to indicate the property is writeOnly.
* It takes an optional boolean which can be used to explicitly set writeOnly true/false
* It takes an optional boolean which can be used to explicitly set writeOnly true/false.
*
* {@link writeOnly|https://json-schema.org/latest/json-schema-validation.html#rfc.section.10.3}
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.10.3|reference}
* @param {boolean|undefined} isWriteOnly
* @returns {BaseSchema}
*/
Expand All @@ -183,7 +183,7 @@ const BaseSchema = (
* - S.prop('prop', S.number()).required()
* - S.required(['foo', 'bar'])
*
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.5.3}
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.5.3|reference}
* @returns {FluentSchema}
*/
required: props => {
Expand All @@ -199,6 +199,14 @@ const BaseSchema = (
})
},

/**
* This keyword's value MUST be a valid JSON Schema.
* An instance is valid against this keyword if it fails to validate successfully against the schema defined by this keyword.
*
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.7.4|reference}
* @param {FluentSchema} not
* @returns {BaseSchema}
*/
not: not => {
if (!isFluentSchema(not))
throw new FluentSchemaError("'not' must be a BaseSchema")
Expand All @@ -219,9 +227,9 @@ const BaseSchema = (
// return setAttribute({ schema, ...options }, ['defaults', defaults, 'any'])

/**
* It MUST be a non-empty array. Each item of the array MUST be a valid JSON Schema.
* It MUST be a non-empty array. Each item of the array MUST be a valid JSON Schema.
*
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.7.3}
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.7.2|reference}
* @param {array} schemas
* @returns {BaseSchema}
*/
Expand All @@ -231,7 +239,7 @@ const BaseSchema = (
/**
* It MUST be a non-empty array. Each item of the array MUST be a valid JSON Schema.
*
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.7.1}
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.7.1|reference}
* @param {array} schemas
* @returns {BaseSchema}
*/
Expand All @@ -241,19 +249,13 @@ const BaseSchema = (
/**
* It MUST be a non-empty array. Each item of the array MUST be a valid JSON Schema.
*
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.7.3|reference}
* @param {array} schemas
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.7.2}
* @returns {BaseSchema}
*/

oneOf: schemas => setComposeType({ prop: 'oneOf', schemas, schema, options }),

/**
* Set a property to type string
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.1.1}
* @returns {BaseSchema}
*/

/**
* @private set a property to a type. Use string number etc.
* @returns {BaseSchema}
Expand All @@ -267,8 +269,9 @@ const BaseSchema = (
* validation succeeds against this keyword if the instance also successfully validates against this keyword's subschema.
*
* @param {BaseSchema} ifClause
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.6.1|reference}
* @param {BaseSchema} thenClause
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.6.1}
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.6.2|reference}
* @returns {BaseSchema}
*/

Expand Down Expand Up @@ -312,9 +315,11 @@ const BaseSchema = (
* then validation succeeds against this keyword if the instance successfully validates against this keyword's subschema.
*
* @param {BaseSchema} ifClause
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.6.1|reference}
* @param {BaseSchema} thenClause
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.6.2|reference}
* @param {BaseSchema} elseClause
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.6.1}
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.6.3|reference}
* @returns {BaseSchema}
*/

Expand Down Expand Up @@ -375,7 +380,7 @@ const BaseSchema = (
* - S.string().format('date').raw({ formatMaximum: '2020-01-01' })
*
* @param {string} fragment an arbitrary JSON Schema to inject
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.3.3}
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.3.3|reference}
* @returns {BaseSchema}
*/
raw: fragment => {
Expand Down
15 changes: 7 additions & 8 deletions src/FluentSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const S = (
/**
* Set a property to type string
*
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.1.1}
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.3|reference}
* @returns {StringSchema}
*/

Expand All @@ -53,7 +53,7 @@ const S = (
/**
* Set a property to type number
*
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#numeric}
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#numeric|reference}
* @returns {NumberSchema}
*/

Expand All @@ -67,7 +67,7 @@ const S = (
/**
* Set a property to type integer
*
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#numeric}
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#numeric|reference}
* @returns {IntegerSchema}
*/

Expand All @@ -81,7 +81,7 @@ const S = (
/**
* Set a property to type boolean
*
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#general}
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.7|reference}
* @returns {BooleanSchema}
*/

Expand All @@ -95,7 +95,7 @@ const S = (
/**
* Set a property to type array
*
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.4}
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.4|reference}
* @returns {ArraySchema}
*/

Expand All @@ -109,7 +109,7 @@ const S = (
/**
* Set a property to type object
*
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.5}
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.5|reference}
* @returns {ObjectSchema}
*/

Expand All @@ -123,7 +123,7 @@ const S = (
/**
* Set a property to type null
*
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#general}
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#general|reference}
* @returns {NullSchema}
*/

Expand Down Expand Up @@ -173,7 +173,6 @@ const S = (
* - S.string().format('date').raw({ formatMaximum: '2020-01-01' })
*
* @param {string} fragment an arbitrary JSON Schema to inject
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.3.3}
* @returns {BaseSchema}
*/

Expand Down
2 changes: 1 addition & 1 deletion src/NullSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const NullSchema = ({ schema = initialState, ...options } = {}) => {
/**
* Set a property to type null
*
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.1.1}
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.1.1|reference}
* @returns {FluentSchema}
*/
null: () => setAttribute({ schema, ...options }, ['type', 'null']),
Expand Down
14 changes: 8 additions & 6 deletions src/NumberSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ const NumberSchema = (
/**
* It represents an inclusive lower limit for a numeric instance.
*
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.2.4|reference}
* @param {number} min
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.2.4}
* @returns {FluentSchema}
*/

Expand All @@ -43,8 +43,8 @@ const NumberSchema = (
/**
* It represents an exclusive lower limit for a numeric instance.
*
* * @param {number} min
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.2.5}
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.2.5|reference}
* @param {number} min
* @returns {FluentSchema}
*/

Expand All @@ -62,7 +62,9 @@ const NumberSchema = (

/**
* It represents an inclusive upper limit for a numeric instance.
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.2.2}
*
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.2.2|reference}
* @param {number} max
* @returns {FluentSchema}
*/

Expand All @@ -77,8 +79,8 @@ const NumberSchema = (
/**
* It represents an exclusive upper limit for a numeric instance.
*
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.2.3|reference}
* @param {number} max
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.2.3}
* @returns {FluentSchema}
*/

Expand All @@ -97,8 +99,8 @@ const NumberSchema = (
/**
* It's strictly greater than 0.
*
* {@link https://tools.ietf.org/id/draft-handrews-json-schema-validation-01.html#rfc.section.6.2.1|reference}
* @param {number} multiple
* {@link reference|https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.2.1}
* @returns {FluentSchema}
*/

Expand Down
Loading

0 comments on commit 09f0d14

Please sign in to comment.