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

Add examples property to Schema #654

Merged
merged 1 commit into from
Mar 7, 2025

Conversation

madjar
Copy link
Contributor

@madjar madjar commented Feb 28, 2025

Fixes #653

@@ -103,6 +103,10 @@ defmodule OpenApiSpex.SchemaTest do
assert Schema.example(%Schema{type: :string, example: "foo"}) == "foo"
end

test "uses the first value in `examples` property when not nil" do
Copy link
Contributor

Choose a reason for hiding this comment

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

[note] Returning the first value seems consistent with how https://editor-next.swagger.io/ generates examples.

Copy link
Contributor

@zorbash zorbash left a comment

Choose a reason for hiding this comment

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

There's a dialyzer error which can be addressed with https://github.com/open-api-spex/open_api_spex/pull/654/files#r1978005779

@zorbash zorbash mentioned this pull request Mar 3, 2025
@madjar madjar force-pushed the schema-examples branch from 9833031 to e427952 Compare March 4, 2025 10:01
@madjar
Copy link
Contributor Author

madjar commented Mar 7, 2025

I am at loss about this test failure. It only happens on one square of the test matrix, and on something that doesn't look related to the changes. Do you have an idea what could be happening here? Otherwise, I can try to reproduce that environment and debug this.

@zorbash
Copy link
Contributor

zorbash commented Mar 7, 2025

I am at loss about this test failure. It only happens on one square of the test matrix, and on something that doesn't look related to the changes. Do you have an idea what could be happening here? Otherwise, I can try to reproduce that environment and debug this.

It's an unrelated flaky test.

@zorbash zorbash merged commit 4a3f7a3 into open-api-spex:master Mar 7, 2025
12 of 16 checks passed
@madjar
Copy link
Contributor Author

madjar commented Mar 7, 2025

Thanks!

@madjar madjar deleted the schema-examples branch March 7, 2025 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Schema is missing an examples properties
2 participants