Skip to content

Conversation

dev-geddy
Copy link

No description provided.

Copy link

changeset-bot bot commented Aug 26, 2025

🦋 Changeset detected

Latest commit: 097b0bf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
swagger-typescript-api Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@smorimoto

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@dev-geddy dev-geddy force-pushed the feat/add-jsonld-schema-support branch from 6de32e5 to 2c0e0b7 Compare September 3, 2025 20:04
@smorimoto

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@smorimoto
Copy link
Collaborator

@codex review

chatgpt-codex-connector[bot]

This comment was marked as outdated.

@smorimoto smorimoto added the enhancement New feature or request label Sep 16, 2025
@dev-geddy
Copy link
Author

@codex fix comments

This comment was marked as off-topic.

@dev-geddy dev-geddy force-pushed the feat/add-jsonld-schema-support branch from 314f0e3 to 045fe31 Compare September 24, 2025 21:50
@smorimoto
Copy link
Collaborator

@codex review

chatgpt-codex-connector[bot]

This comment was marked as outdated.

@smorimoto
Copy link
Collaborator

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

Comment on lines +222 to +253
private resolveProperty(
key: string,
value: any,
context?: JsonLdContext,
): any {
// Basic type inference from value
if (typeof value === "string") {
return { type: "string" };
}
if (typeof value === "number") {
return { type: "number" };
}
if (typeof value === "boolean") {
return { type: "boolean" };
}
if (Array.isArray(value)) {
return {
type: "array",
items:
value.length > 0
? this.resolveProperty(`${key}_item`, value[0], context)
: { type: "string" },
};
}
if (typeof value === "object" && value !== null) {
if (this.isJsonLdSchema(value)) {
return this.resolveJsonLdSchema(value);
}
return {
type: "object",
additionalProperties: true,
};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve typed properties when normalizing JSON-LD schemas

The JSON-LD resolver replaces every object-valued property that doesn’t itself look like a JSON-LD schema with { type: "object", additionalProperties: true }. Because the property loop assigns this result back to resolvedSchema.properties[key], ordinary JSON Schema definitions such as { type: "string", format: "email" } are discarded and later become Record<string, any> in the generated interfaces (see the snapshots where name/email lose their string types). This wipes out the original typing for JSON-LD entity fields and materially reduces accuracy. The resolver should leave non‑JSON‑LD property schemas intact (or copy them through) instead of blindly converting them to a generic object.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants