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

Adds missing type-family & type-class instances for SecuirtyDefinitions type to make it work with indexed lenses #78

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/Data/OpenApi/Lens.hs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ instance At Operation where at n = responses . at n

instance HasType NamedSchema (Maybe OpenApiType) where type_ = schema.type_

-- Type family instances for SecurityDefinitions type
type instance Index SecurityDefinitions = Text
type instance IxValue SecurityDefinitions = SecurityScheme

-- Type-Class instances for SecurityDefinitions type
instance Ixed SecurityDefinitions where ix n = (coerced :: Lens' SecurityDefinitions (Definitions SecurityScheme)). ix n
instance At SecurityDefinitions where at n = (coerced :: Lens' SecurityDefinitions (Definitions SecurityScheme)). at n

-- OVERLAPPABLE instances

instance
Expand Down