---
title: "Discussion on \"The JSON Schema constraints that actually work in OpenAPI: format, pattern, ranges, and what codegen and AI mocks do with them\" | Hashnode"
description: "Discussion on \"The JSON Schema constraints that actually work in OpenAPI: format, pattern, ranges, and what codegen and AI mocks do with them\". Which JSON Schema keywords become types, which are enforced at runtime, and which are only annotations? Here is how format, pattern, ranges, required, and nullability flow into codegen, validators, mocks, and AI-generated test data."
url: "https://hashnode.com/posts/openapi-json-schema-formats-constraints-codegen-mocks/6aca079ca1275270452d8331"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [The JSON Schema constraints that actually work in OpenAPI: format, pattern, ranges, and what codegen and AI mocks do with them](https://blogs.powerduck.com/openapi-json-schema-formats-constraints-codegen-mocks?utm_source=hashnode&utm_medium=feed)

Which JSON Schema keywords become types, which are enforced at runtime, and which are only annotations? Here is how format, pattern, ranges, required, and nullability flow into codegen, validators, mocks, and AI-generated test data.

Oct 7 · 7 min read · blogs.powerduck.com  
Read the article

-   [#openapi](https://hashnode.com/tag/openapi)
-   [#json-schema](https://hashnode.com/tag/json-schema)
-   [#codegen](https://hashnode.com/tag/codegen)
-   [#validation](https://hashnode.com/tag/validation)

## Written by

[Powerduck](https://hashnode.com/@powerduck)

@powerduck · hon

  
[View profile](https://hashnode.com/@powerduck)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
