astahmer / openapi-zod-client

Generate a zodios (typescript http client with zod validation) from an OpenAPI spec (json/yaml)

Home Page:openapi-zod-client.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

only first newline is truncated from schema description

scarf005 opened this issue · comments

commented

if (options?.withDescription && paramSchema) {
(paramSchema as SchemaObject).description = (paramItem.description ?? "")?.replace("\n", "");
}

as String.prototype.replace replaces at most once, String.prototype.replaceAll needs to be used instead.

however, stripping newlines could cause unexpected behavior. maybe template literal(`) should be used instead?