Blackstone · API Governance Rules

Blackstone API Rules

Spectral linting rules defining API design standards and conventions for Blackstone.

5 Rules warn 5
View Rules File View on GitHub

Rule Categories

blackstone

Rules

warn
blackstone-fund-strategy-enum
Fund strategy must be one of the defined values
$.components.schemas.Fund.properties.strategy
warn
blackstone-currency-required
Financial records must include a currency field
$.components.schemas[*].properties
warn
blackstone-date-iso-format
Date fields must use ISO 8601 format
$.components.schemas[*].properties[?(@.description =~ /date/i)]
warn
blackstone-operations-have-descriptions
All API operations should include descriptions
$.paths[*][*]
warn
blackstone-ids-are-strings
All ID fields should be of type string
$.components.schemas[*].properties[?(@.description =~ /identifier|id/i)]

Spectral Ruleset

blackstone-spectral-rules.yml Raw ↑
rules:
  blackstone-fund-strategy-enum:
    description: Fund strategy must be one of the defined values
    message: "Fund strategy must use a defined enum value"
    given: "$.components.schemas.Fund.properties.strategy"
    then:
      field: enum
      function: truthy

  blackstone-currency-required:
    description: Financial records must include a currency field
    message: "Currency is required on financial records"
    given: "$.components.schemas[*].properties"
    then:
      field: currency
      function: defined

  blackstone-date-iso-format:
    description: Date fields must use ISO 8601 format
    message: "Date fields must specify format: date or date-time"
    given: "$.components.schemas[*].properties[?(@.description =~ /date/i)]"
    then:
      field: format
      function: pattern
      functionOptions:
        match: "^date"

  blackstone-operations-have-descriptions:
    description: All API operations should include descriptions
    message: "Operation is missing a description"
    given: "$.paths[*][*]"
    then:
      field: description
      function: truthy

  blackstone-ids-are-strings:
    description: All ID fields should be of type string
    message: "ID fields must be of type string"
    given: "$.components.schemas[*].properties[?(@.description =~ /identifier|id/i)]"
    then:
      field: type
      function: pattern
      functionOptions:
        match: "^string$"