You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"ApiError": {
"type": "object",
"properties": {
"attribute": {
"type": "string",
"description": "The attribute that this error applies to. Omitted if this error is not in the context of a resource, or cannot be isolated to a single attribute.\n"
},
"type": {
"type": "string",
"description": "A classification for this error, which can be used to render the appropriate custom error template, or take other programmatic actions.\n"
},
"details": {
"description": "Variables associated with this error that can be injected into a custom error template, or used to parameterize any other programatic actions.\n",
"allOf": [
{
"type": "object",
"additionalProperties": {
"type": "string"
}
}
]
},
"message": {
"type": "string",
"description": "A human-readable, English description of the error.\n"
}
}
},
Resulting code:
/*
* This file was generated by guardrail (https://github.com/guardrail-dev/guardrail).
* Modifications will be overwritten; instead edit the OpenAPI/Swagger spec file.
*/
package com.evenfinancial.finance.v1.http4s.client.definitions
import cats.syntax.either._
import io.circe.syntax._
import cats.instances.all._
import _root_.com.evenfinancial.finance.v1.http4s.client.Implicits._
case class ApiError(attribute: Option[String] = None, `type`: Option[String] = None, details: Option[ApiError.Details] = None, message: Option[String] = None)
object ApiError {
implicit val encodeApiError: _root_.io.circe.Encoder.AsObject[ApiError] = {
val readOnlyKeys = _root_.scala.Predef.Set[_root_.scala.Predef.String]()
_root_.io.circe.Encoder.AsObject.instance[ApiError](a => _root_.io.circe.JsonObject.fromIterable(_root_.scala.Vector(("attribute", a.attribute.asJson), ("type", a.`type`.asJson), ("details", a.details.asJson), ("message", a.message.asJson)))).mapJsonObject(_.filterKeys(key => !(readOnlyKeys contains key)))
}
implicit val decodeApiError: _root_.io.circe.Decoder[ApiError] = new _root_.io.circe.Decoder[ApiError] { final def apply(c: _root_.io.circe.HCursor): _root_.io.circe.Decoder.Result[ApiError] = for (v0 <- c.downField("attribute").as[Option[String]]; v1 <- c.downField("type").as[Option[String]]; v2 <- c.downField("details").as[Option[ApiError.Details]]; v3 <- c.downField("message").as[Option[String]]) yield ApiError(v0, v1, v2, v3) }
}
There's no ApiError.Details generated.
The text was updated successfully, but these errors were encountered:
Just to confirm, this did work if not trying to inline the object:
"ApiError": {
"type": "object",
"properties": {
"attribute": {
"type": "string",
"description": "The attribute that this error applies to. Omitted if this error is not in the context of a resource, or cannot be isolated to a single attribute.\n"
},
"type": {
"type": "string",
"description": "A classification for this error, which can be used to render the appropriate custom error template, or take other programmatic actions.\n"
},
"details": {
"description": "Variables associated with this error that can be injected into a custom error template, or used to parameterize any other programatic actions.\n",
"allOf": [
{
"$ref": "#/components/schemas/ApiErrorDetails"
}
]
},
"message": {
"type": "string",
"description": "A human-readable, English description of the error.\n"
}
}
},
"ApiErrorDetails": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
Resulting code:
There's no
ApiError.Details
generated.The text was updated successfully, but these errors were encountered: