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

Avoid compile time dependencies #536

Merged
merged 1 commit into from
May 5, 2023
Merged

Conversation

doorgan
Copy link
Contributor

@doorgan doorgan commented May 5, 2023

It's common to pass schema structs as types for the parameters in an operation, like:

operation :foo,
  request_body: {"Request", "application/json", properties: %{bar: ApiSchemas.Bar}

Without escaping that module alias, this introduces a compile time dependency between the controller using operation and the schema module.

This PR fixes that. I'm not sure if this issue exists in other macros, but I think this same approach can be used in any place where this happens.

@zorbash
Copy link
Contributor

zorbash commented May 5, 2023

See also phoenixframework/phoenix_live_view@f397224

@zorbash zorbash merged commit 5d48652 into open-api-spex:master May 5, 2023
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.

2 participants