---
title: "Discussion on \"readOnly and writeOnly in OpenAPI: one schema for create, response, and password fields\" | Hashnode"
description: "Discussion on \"readOnly and writeOnly in OpenAPI: one schema for create, response, and password fields\". The server returns id, created_at, and version but must reject them on input; the client sends password and current_password that must never come back. One schema with readOnly and writeOnly properties models both directions and codegen splits it into request and response types a"
url: "https://hashnode.com/posts/openapi-readonly-writeonly-request-response-fields/6aca078f5dcb9493e31522e4"
---

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

Discussion

# [readOnly and writeOnly in OpenAPI: one schema for create, response, and password fields](https://blogs.powerduck.com/openapi-readonly-writeonly-request-response-fields?utm_source=hashnode&utm_medium=feed)

The server returns id, created\_at, and version but must reject them on input; the client sends password and current\_password that must never come back. One schema with readOnly and writeOnly properties models both directions and codegen splits it into request and response types a

Oct 8 · 6 min read · blogs.powerduck.com  
Read the article

-   [#openapi](https://hashnode.com/tag/openapi)
-   [#api-design](https://hashnode.com/tag/api-design)
-   [#codegen](https://hashnode.com/tag/codegen)
-   [#best-practices](https://hashnode.com/tag/best-practices)

## Written by

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

@powerduck · hon

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

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
