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 support for Flint schemas and validations #76

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

acalejos
Copy link

This PR does the following:

  • Adds Flint as an optional dependency
  • If Flint is present, creates the Instructor.Instruction module as a Flint extension
    • This will register the :doc option that can be used within embedded_schema fields
    • It will also create a default callback implementation for validate_changeset that validates the changeset according to the Flint extensions pipeline for the module
  • Switches the order of the cond conditions when checking for validate_changeset callbacks such that if botharities of callback are available, then the arity-2 callback (that takes the context) takes priority
  • Updates the json schema generation logic to use the :doc field options and moduledoc only if available. It maintains supports for the existing behavior

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.

1 participant