samchon / nestia

NestJS Helper Libraries + TypeScript OpenAPI generator
https://nestia.io/
MIT License
1.71k stars 89 forks source link

Nestia v2 -> v3 Migration #867

Open SatyaanM opened 3 months ago

SatyaanM commented 3 months ago

Hi @samchon , thank you for the great work on nestia and typia! I saw v3 is released and I have some questions about upgrading.

  1. Is it possible to disable inferring the Title from the first line of a comment?

    • I saw this mentioned on https://github.com/samchon/typia/issues/976
    • The broken links from inferred titles were fixed. However, inferring titles breaks some things for me as I can't control the comments if I import types from a package.
    • I can submit a PR for this if you'd like
  2. info.license.identifier and info.license.url is not being generated in the OpenAPI 3.1.0 file. Can I configure these values somewhere or is this not supported?

samchon commented 2 months ago

Sorry for long time waiting.

Automatic JsonSchema.title composition

As considering the first line terminated with dot (.) as @summary or @title feature was traditional convention from very long time ago (ASDoc, JavaDoc), I don't want to disable it. Instead, you can skip the first line to be @summary or @title by not terminating with the dot (.) characeter.

info.license.identifier

You can configure it onto the nestia.config.ts file.

import { INestiaConfig } from "@nestia/sdk";

export const NESTIA_CONFIG: INestiaConfig = {
  input: ["src/controllers"],
  output: "src/api",
  swagger: {
    output: "swagger.json",
    info: { ... },
  },
};
export default NESTIA_CONFIG;

https://nestia.io/docs/sdk/swagger/#configuration