microsoft/OpenApi.ApiManifest

Add Validation Based on API Manifest Spec

Closed this issue · 0 comments

See https://www.ietf.org/archive/id/draft-miller-api-manifest-01.html.

Validation should be based on the following rules:

Validation Rules

; Information about an application that consumes HTTP APIs.
apiManifest = {
    applicationName: tstr
    ? publisher: publisher
    apiDependencies : {* tstr => apiDependency}
    extensibility # what's an appropriate property name and type? extensibility vs extensions?
}

; Identification of the application developer / organization
publisher = {
    name: tstr
    contactEmail: tstr
}

;  Declaration of application dependencies on HTTP API
apiDependency = {
    ? apiDescriptionUrl: tstr
    ? apiDescriptionVersion: tstr
    ? apiDeploymentBaseUrl: tstr # Missing in [section 2.3](https://www.ietf.org/archive/id/draft-miller-api-manifest-01.html#section-2.3). Should be added to the spec.
    authorizationRequirements: authorizationRequirements # Needs requirement level in [section 2.3](https://www.ietf.org/archive/id/draft-miller-api-manifest-01.html#section-2.3). Should we assume optional?
    requests: [+ requestInfo] # Needs requirement level in [section 2.3](https://www.ietf.org/archive/id/draft-miller-api-manifest-01.html#section-2.3). Should we assume optional?
    extensibility # what's an appropriate property name and type? extensibility vs extensions?
}

; Permissions required by client application for the described dependency
authorizationRequirements = {
    ? clientIdentifier: tstr # Name does not match [section 2.4](https://www.ietf.org/archive/id/draft-miller-api-manifest-01.html#section-2.4)
    ? access: [+accessRequest] | [+tstr]
}

extensibility = (
    ? extensions => {* tstr => any }
)
accessRequest = {
    type : tstr ;
    * tstr => any;
}

; Details of a resource request
requestInfo = {
    method: tstr # Requirement level is not specified in [section 2.5. Request Info Object](https://www.ietf.org/archive/id/draft-miller-api-manifest-01.html#section-2.5)
    uriTemplate: tstr # Requirement level is not specified in [section 2.5. Request Info Object](https://www.ietf.org/archive/id/draft-miller-api-manifest-01.html#section-2.5)
    ? dataClassification: [* tstr]
}

Tasks (list will be updated and sub-issues created after the discussion at #7)

Spec