Skip to content

Merge upstream open_api_spex master - #6

Merged
aspett-remote merged 24 commits into
masterfrom
merge-upstream
Aug 18, 2026
Merged

Merge upstream open_api_spex master#6
aspett-remote merged 24 commits into
masterfrom
merge-upstream

Conversation

@aspett-remote

Copy link
Copy Markdown
Collaborator

zorbash and others added 24 commits March 3, 2025 19:30
* Add mix spec.yaml tasks in example applications

* Update example application dependencies
* Fix Elixir 1.18 compilation warnings

* Test against 1.18
* Refactor: Update default parsers and schema pattern definitions

This commit introduces changes to `OpenApiSpex.CastParameters` and `OpenApiSpexTest.Schemas`.

- Moved `@default_parsers` to a private function `default_parsers/0` in `OpenApiSpex.CastParameters` to ensure it's evaluated at runtime, preventing potential compilation issues with `OpenApi.json_encoder()`.
- Updated the `pattern` definition in `OpenApiSpexTest.Schemas` to use a string literal instead of a regex literal for consistency and to avoid potential issues with regex compilation.

Fix: Adjust string pattern test assertion

Following the refactoring, a test in `OpenApiSpex.CastStringTest` failed due to a change in how regex patterns were handled. This fix corrects the assertion for string pattern matching to compare the `source` of the regex instead of the regex struct directly, resolving the test failure.

* Fix formatting

---------

Co-authored-by: Dimitris Zorbas <dimitrisplusplus@gmail.com>
* Support references in assert_operation_response/2

* fixup! Support references in assert_operation_response/2
A new release will be out soon, this will allow users to migrate if desired.
The new version is compatible with OpenAPISpex.
Merges origin/master (open-api-spex/open_api_spex) into the remoteoss
fork. 23 upstream commits; 3 files conflicted.

Conflict resolutions:

* lib/open_api_spex/inspect/for_schema.ex - took upstream. Both sides
  independently fixed the Elixir 1.19 Inspect.Map breakage; upstream
  version-gates inspect_as_struct/5 vs inspect/4, the fork switched to
  concat/to_doc. test/inspect/for_schema_test.exs (identical on both
  branches) asserts the `%OpenApiSpex.Schema{...}` format, which only
  upstream's version produces. This drops fork commit 0560348.

* lib/open_api_spex/schema_resolver.ex - kept the fork's clauses, which
  are a superset: {mod, func} schema references with the
  title-must-be-defined raise, plus tuple discriminator mappings. Both
  now layer on top of upstream's duplicate-title dedupe.

* test/schema_resolver_test.exs - rebuilt from upstream (which wraps the
  tests in `describe "resolve_schema_modules/1"`, re-indenting them) and
  re-applied the fork's three additions at the new indentation: the
  /api/credit-cards path, the nail_clipping discriminator assertion, and
  "CreditCardNumber" in the components.schemas assertion. The automatic
  merge had misaligned this file outside the conflict markers.

mix test: 400 passed. mix format --check-formatted: ok.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@aspett-remote aspett-remote self-assigned this Aug 18, 2026
@aspett-remote
aspett-remote marked this pull request as ready for review August 18, 2026 23:46
@aspett-remote
aspett-remote merged commit a31309a into master Aug 18, 2026
9 checks passed
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.