Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Record<string, string> bug of typia.json.application<"3.1">() function. #1025

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

samchon
Copy link
Owner

@samchon samchon commented Apr 12, 2024

Have taken a mistake that when named object expression type comes to OpenAPI v3.1 specified JSON schema, typia generated wrong JSON schema like below.

This PR fixes the bug.

import typia from "typia";

typia.json.application<[Record<string, string>]>();
({
  version: "3.1",
  components: {
    schemas: {
      Recordstringstring: {
        $ref: "#/components/schemas/Recordstringstring",
        description: "Construct a type with a set of properties K of type T",
        additionalProperties: {
          type: "string",
        },
      },
    },
  },
  schemas: [
    {
      $ref: "#/components/schemas/Recordstringstring",
    },
  ],
});

… function.

Have taken a mistake that when named object expression type comes to OpenAPI v3.1 specified JSON schema, `typia` generated wrong JSON schema like below.

This PR fixes the bug.

```typescript
import typia from "typia";

typia.json.application<[Record<string, string>]>();
```

```javascript
({
  version: "3.1",
  components: {
    schemas: {
      Recordstringstring: {
        type: "object",
        properties: {},
        description: "Construct a type with a set of properties K of type T",
        additionalProperties: {
          type: "string",
        },
      },
    },
  },
  schemas: [
    {
      $ref: "#/components/schemas/Recordstringstring",
    },
  ],
});
```
@samchon samchon added the bug Something isn't working label Apr 12, 2024
@samchon samchon self-assigned this Apr 12, 2024
@samchon samchon merged commit 4cb9dec into master Apr 12, 2024
2 of 3 checks passed
@samchon samchon deleted the features/recursive branch April 12, 2024 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant