-
Notifications
You must be signed in to change notification settings - Fork 145
Open
Labels
bugSomething isn't workingSomething isn't working
Description
What version of ogen are you using?
Latest commit at the main branch:
go run github.com/ogen-go/ogen/cmd/ogen@a794ac8
Can this issue be reproduced with the latest version?
Yes
What did you do?
I am trying to add nullable
property using allOf
:
schema:
type: object
properties:
field_1: # this field causes issues.
allOf:
- $ref: "#/components/schemas/dateTime"
- nullable: true
Full openapi.yaml
:
openapi: 3.0.2
servers:
- url: http://localhost:8000/api/v1
info:
version: 1.0.0
title: issue example
paths:
/example:
patch:
requestBody:
required: true
content:
"application/json":
schema:
type: object
properties:
field_1: # this field causes issues.
allOf:
- $ref: "#/components/schemas/dateTime"
- nullable: true
field_2:
type: string
nullable: true
field_3: # reference field without issues.
type: string
responses:
"200":
description: "OK"
components:
schemas:
dateTime:
type: string
format: date-time
description: |
Date and Time
[RFC3339](https://www.rfc-editor.org/rfc/rfc3339)
example: "2006-01-02T15:04:05Z07:00"
What did you expect to see?
No compilation errors and nullable field.
What did you see instead?
$ go run github.com/ogen-go/ogen/cmd/ogen@a794ac8 -v --clean --config generate_config.yaml --target . -package example openapi.yaml
$ go build .
# ogenissue
./oas_json_gen.go:25:20: not enough arguments in call to s.Field1.Encode
have (*jx.Encoder)
want (*jx.Encoder, func(*jx.Encoder, time.Time))
Full example of the issue available here: https://github.com/WinPooh32/ogenissue
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working