Skip to content

Conversation

@mdrafi28
Copy link
Contributor

@mdrafi28 mdrafi28 commented Oct 18, 2025

Resolves #82

This PR addresses the documentation and script references for OpenAPI 3.2 support. While OpenAPI 3.2 functionality was already working, it was not properly documented.

Changes made:

  • Updated package.json scripts to clearly indicate OpenAPI 3.2 compatibility.
  • Revised the README to reflect that OpenAPI 3.2 is supported.

With these updates, users and contributors can now easily identify OpenAPI 3.2 support, and the project continues to function without any issues.

Copy link
Collaborator

@jdesrosiers jdesrosiers left a comment

Choose a reason for hiding this comment

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

I was going to work on this today, but I'm happy to have you contribute instead.

There's a little more to this one than adding an export and updating the README. There are two things missing: update the schema (schema.js) and update the OpenApi type (index.d.ts).

The schema can be found at https://spec.openapis.org/oas/3.2/schema/2025-09-17.html.

For the OpenApi type, start by copying the type from openapi-3-2 and make whatever changes are needed to make it support 3.2. The best way is probably to compare what changed from the 3.1 schema to the 3.2 and make changes accordingly.

package.json Outdated
"typescript-eslint": "*",
"undici": "*",
"vitest": "*",
"vitest": "^3.2.4",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Change this back.

README.md Outdated
Comment on lines 159 to 171
<!-- ## `package.json` Exports -->
<!-- ```json
"exports": {
"./openapi-3-0": "./openapi-3-0/index.js",
"./openapi-3-1": "./openapi-3-1/index.js",
"./openapi-3-2": "./openapi-3-2/index.js"
} -->

**`package.json` exports** — add:

```json
"./openapi-3-2": "./openapi-3-2/index.js"

Copy link
Collaborator

Choose a reason for hiding this comment

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

What is this? Looks like AI slop.

@mdrafi28
Copy link
Contributor Author

I was going to work on this today, but I'm happy to have you contribute instead.

There's a little more to this one than adding an export and updating the README. There are two things missing: update the schema (schema.js) and update the OpenApi type (index.d.ts).

The schema can be found at https://spec.openapis.org/oas/3.2/schema/2025-09-17.html.

For the OpenApi type, start by copying the type from openapi-3-2 and make whatever changes are needed to make it support 3.2. The best way is probably to compare what changed from the 3.1 schema to the 3.2 and make changes accordingly.

The schema.js, index.d.ts and other files of OpenApi (openApi-3-2) has been revised accordingly to the requirements has been addressed.
Is there any other changes i missed.

@mdrafi28 mdrafi28 requested a review from jdesrosiers October 19, 2025 06:13
Copy link
Collaborator

@jdesrosiers jdesrosiers left a comment

Choose a reason for hiding this comment

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

I appreciate that you found a couple typos! Thanks! But, much of this still looks like AI slop, especially the OpenAPI32 type. It's incomplete and references types that don't exist. Start by making a copy of the 3.1 version and make changes from there.

I suggest you turn off the AI and use your own intelligence for this one. It's hurting more than helping. One of the things you did was to change several schemas to be the same (wrong) schema. If you were using your own intellegence, you would have realized that it doesn't make any sense to have six copies of the same schema and there's a reason for the differences.

it(test.description, () => {
const output = _validate(test.data);
expect(output.valid).to.equal(test.valid);
expect(output.valid).toBe(test.valid);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Change this back. Avoid unnecessary changes.

"type": "string"
},
"mapping": {
"mappings": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is wrong. Change it back.

wrapped?: boolean;
};

// TODO: Fill in this type when 3.2 is published
Copy link
Collaborator

Choose a reason for hiding this comment

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

This comment can be removed since we're filling in the type now.

it(test.description, () => {
const output = _validate(test.data);
expect(output.valid).to.equal(test.valid);
expect(output.valid).toBe(test.valid);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Change this back.


"$defs": {
"dialect": { "const": "https://spec.openapis.org/oas/3.2/dialect/base" },
"dialect": { "const": "https://json-schema.org/draft/2020-12/schema" },
Copy link
Collaborator

Choose a reason for hiding this comment

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

Change this back. schema-base uses the OpenAPI JSON Schema dialect. Change the description back as well.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see you did the same thing with the rest of the schema-draft-x schemas. Change them all back. They were correct as they were.

Choose a reason for hiding this comment

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

Change this back. schema-base uses the OpenAPI JSON Schema dialect. Change the description back as well.

is it like we have to use OpenAPI json Schema dialect for the cases when there might be chances of breakout in code ? but "https://spec.openapis.org/oas/3.2/dialect/base" this link is not working and showing 404.

Copy link
Collaborator

Choose a reason for hiding this comment

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

OpenAPI allows you to use any dialect of JSON Schema you like, but it defaults to using the OpenAPI version of JSON Schema whose identifier is https://spec.openapis.org/oas/3.2/dialect/base. Keep in mind that JSON Schema identifiers aren't necessarily hosted on the web. It just needs to be loaded into the validator.

So, schema-base is the schema for OpenAPI with the default JSON Schema dialect. Then I also include schema-draft-x for each of the JSON Schema dialects this package supports. For example, schema-draft-07 is the schema for OpenAPI with the JSON Schema draft-07 dialect.

Hope that makes it more clear. I'm happy to answer any questions.

Choose a reason for hiding this comment

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

Actually default latest dialect $id for 3.2 is https://spec.openapis.org/oas/3.2/dialect/2025-09-17 (which is also a valid resolvable url)

As described here: https://spec.openapis.org/oas/3.2/schema-base/2025-09-17.html

They changed to date based versioning for dialect schema as of version 2024‑11‑14

Copy link
Collaborator

Choose a reason for hiding this comment

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

I chose to only include the latest version in this package and to maintain the dateless URI as an alias for the latest version. If users feel like they need a specific version, they can load those schemas themselves.

@mdrafi28
Copy link
Contributor Author

mdrafi28 commented Oct 21, 2025

I appreciate that you found a couple typos! Thanks! But, much of this still looks like AI slop, especially the OpenAPI32 type. It's incomplete and references types that don't exist. Start by making a copy of the 3.1 version and make changes from there.

I suggest you turn off the AI and use your own intelligence for this one. It's hurting more than helping. One of the things you did was to change several schemas to be the same (wrong) schema. If you were using your own intellegence, you would have realized that it doesn't make any sense to have six copies of the same schema and there's a reason for the differences.

Thank you for your guidance. I have removed the unwanted changes and reverted to previous structure, can you review the updated version and let me know if anything needs to be done regarding this issue.

@mdrafi28 mdrafi28 requested a review from jdesrosiers October 21, 2025 17:31
Copy link
Collaborator

@jdesrosiers jdesrosiers left a comment

Choose a reason for hiding this comment

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

It's looking better, but you still haven't fixed the OpenApi type. Have a close look. Notice that you reference many types that you don't define: Server, SecurityRequirements, Response, Callback, and more.

I'm pushing changes to your branch where I copy the 3.1 type to 3.2 like I suggested you do twice already. Your next step is to make the necessary changes to update the 3.2 copy to reflect the changes from 3.1 -> 3.2.

@jdesrosiers jdesrosiers merged commit dc58152 into hyperjump-io:main Oct 21, 2025
@jdesrosiers
Copy link
Collaborator

@mdrafi28 Sorry, git did something unexpected when I tried to push a commit to help show you what I'm looking for. It ended up removing your commits and closing the PR. That was not my intention, but I can't seem to undo it. Try pushing your commits again and creating a new PR. But, this time do it from a branch. Don't use main.

@mdrafi28
Copy link
Contributor Author

@mdrafi28 Sorry, git did something unexpected when I tried to push a commit to help show you what I'm looking for. It ended up removing your commits and closing the PR. That was not my intention, but I can't seem to undo it. Try pushing your commits again and creating a new PR. But, this time do it from a branch. Don't use main.

#87

@jdesrosiers can u check n tell if there are any other changes to be made

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Support for OpenAPI 3.2

4 participants