Skip to content

Conversation

@jonchun
Copy link
Contributor

@jonchun jonchun commented Jan 27, 2026

Related to #21: The aep-142-time-field-type rule fails to validate nullable timestamp fields in OpenAPI 3.1 specs.

In OAS 3.1, nullable fields are represented using anyOf with a null type. e.g.

delete_time: {
  anyOf: [
    { type: string, format: date-time },
    { type: null }
  ]
}

The current validation checks field.type directly, which is undefined for anyOf structures. This causes false positives for valid nullable _time fields. (such as a delete_time field for soft-deletes)

@jonchun
Copy link
Contributor Author

jonchun commented Jan 27, 2026

Re-opening #71 from a proper branch. @toumorokoshi @mkistler

@mkistler
Copy link
Contributor

mkistler commented Feb 1, 2026

It's not clear to me that we want to allow nullable date/time fields in AEP compliant APIs. I don't see any mention of "null" in AEP 142 currently. If we intend "null" to be meaningful in date/time fields, I think the AEP should state that explicitly.

@jonchun
Copy link
Contributor Author

jonchun commented Feb 1, 2026

That's a fair point. I do think that AEP-142 is a bit too strict then, but that's to be taken up with AEP.

Workaround is clearly documented for anyone who has the same issue I did:

overrides:
  - files:
      - 'openapi.json#/components/schemas/book/properties/expiration'
    rules:
      aep-142-time-field-suffix: 'off'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants