Baxter International · API Governance Rules

Baxter International API Rules

Spectral linting rules defining API design standards and conventions for Baxter International.

5 Rules error 3 warn 2
View Rules File View on GitHub

Rule Categories

baxter

Rules

error
baxter-auth-required
All Baxter DeviceBridge API operations must use authentication.
$.paths.*.*.security
error
baxter-operation-id-required
All Baxter API operations must have an operationId.
$.paths.*.*
warn
baxter-device-id-documented
Device endpoints should document device identifier parameters.
$.paths[?(@property.match('device'))].*.parameters
error
baxter-patient-id-required
Patient data endpoints should require patient identification.
$.paths[?(@property.match('patient'))].*.parameters
warn
baxter-fhir-content-type
FHIR endpoints should produce FHIR-compliant content types.
$.paths[?(@property.match('fhir'))].*.responses.200.content

Spectral Ruleset

baxter-spectral-rules.yml Raw ↑
rules:
  baxter-auth-required:
    description: All Baxter DeviceBridge API operations must use authentication.
    message: Operation must include authentication security requirement.
    severity: error
    given: $.paths.*.*.security
    then:
      function: schema
      functionOptions:
        schema:
          type: array
          minItems: 1

  baxter-operation-id-required:
    description: All Baxter API operations must have an operationId.
    message: Operation is missing operationId.
    severity: error
    given: $.paths.*.*
    then:
      field: operationId
      function: truthy

  baxter-device-id-documented:
    description: Device endpoints should document device identifier parameters.
    message: Device endpoint should document deviceId path or query parameter.
    severity: warn
    given: $.paths[?(@property.match('device'))].*.parameters
    then:
      function: schema
      functionOptions:
        schema:
          type: array
          minItems: 1

  baxter-patient-id-required:
    description: Patient data endpoints should require patient identification.
    message: Patient data endpoint should document patient identifier parameter.
    severity: error
    given: $.paths[?(@property.match('patient'))].*.parameters
    then:
      function: schema
      functionOptions:
        schema:
          type: array
          minItems: 1

  baxter-fhir-content-type:
    description: FHIR endpoints should produce FHIR-compliant content types.
    message: FHIR endpoint should produce application/fhir+json content type.
    severity: warn
    given: $.paths[?(@property.match('fhir'))].*.responses.200.content
    then:
      function: truthy