-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add JSON serialization for AppSpec (#2284)
- Loading branch information
Showing
32 changed files
with
593 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
{-# LANGUAGE DeriveAnyClass #-} | ||
{-# LANGUAGE DeriveDataTypeable #-} | ||
{-# LANGUAGE DeriveGeneric #-} | ||
|
||
module Wasp.AppSpec.ApiNamespace | ||
( ApiNamespace (..), | ||
) | ||
where | ||
|
||
import Data.Aeson (FromJSON) | ||
import Data.Data (Data) | ||
import Wasp.AppSpec.Core.Decl (IsDecl) | ||
import GHC.Generics (Generic) | ||
import Wasp.AppSpec.Core.IsDecl (IsDecl) | ||
import Wasp.AppSpec.ExtImport (ExtImport) | ||
|
||
data ApiNamespace = ApiNamespace | ||
{ middlewareConfigFn :: ExtImport, | ||
path :: String | ||
} | ||
deriving (Show, Eq, Data) | ||
deriving (Show, Eq, Data, Generic, FromJSON) | ||
|
||
instance IsDecl ApiNamespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
{-# LANGUAGE DeriveAnyClass #-} | ||
{-# LANGUAGE DeriveDataTypeable #-} | ||
{-# LANGUAGE DeriveGeneric #-} | ||
|
||
module Wasp.AppSpec.App.Db | ||
( Db (..), | ||
DbSystem (..), | ||
) | ||
where | ||
|
||
import Data.Aeson (FromJSON) | ||
import Data.Data (Data) | ||
import GHC.Generics (Generic) | ||
import Wasp.AppSpec.ExtImport (ExtImport) | ||
|
||
data Db = Db | ||
{ seeds :: Maybe [ExtImport] | ||
} | ||
deriving (Show, Eq, Data) | ||
deriving (Show, Eq, Data, Generic, FromJSON) | ||
|
||
data DbSystem = PostgreSQL | SQLite | ||
deriving (Show, Eq, Data) | ||
deriving (Show, Eq, Data, Generic, FromJSON) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
{-# LANGUAGE DeriveAnyClass #-} | ||
{-# LANGUAGE DeriveDataTypeable #-} | ||
{-# LANGUAGE DeriveGeneric #-} | ||
|
||
module Wasp.AppSpec.App.Server | ||
( Server (..), | ||
) | ||
where | ||
|
||
import Data.Aeson (FromJSON) | ||
import Data.Data (Data) | ||
import GHC.Generics (Generic) | ||
import Wasp.AppSpec.ExtImport (ExtImport) | ||
|
||
data Server = Server | ||
{ setupFn :: Maybe ExtImport, | ||
middlewareConfigFn :: Maybe ExtImport | ||
} | ||
deriving (Show, Eq, Data) | ||
deriving (Show, Eq, Data, Generic, FromJSON) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
{-# LANGUAGE DeriveAnyClass #-} | ||
{-# LANGUAGE DeriveDataTypeable #-} | ||
{-# LANGUAGE DeriveGeneric #-} | ||
|
||
module Wasp.AppSpec.App.Wasp (Wasp (..)) where | ||
|
||
import Data.Aeson (FromJSON) | ||
import Data.Data (Data) | ||
import Wasp.AppSpec.Core.Decl (IsDecl) | ||
import GHC.Generics (Generic) | ||
import Wasp.AppSpec.Core.IsDecl (IsDecl) | ||
|
||
data Wasp = Wasp | ||
{ version :: String | ||
} | ||
deriving (Show, Eq, Data) | ||
deriving (Show, Eq, Data, Generic, FromJSON) | ||
|
||
instance IsDecl Wasp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
{-# LANGUAGE DeriveAnyClass #-} | ||
{-# LANGUAGE DeriveDataTypeable #-} | ||
{-# LANGUAGE DeriveGeneric #-} | ||
|
||
module Wasp.AppSpec.App.WebSocket | ||
( WebSocket (..), | ||
) | ||
where | ||
|
||
import Data.Aeson (FromJSON) | ||
import Data.Data (Data) | ||
import GHC.Generics (Generic) | ||
import Wasp.AppSpec.ExtImport (ExtImport) | ||
|
||
data WebSocket = WebSocket | ||
{ fn :: ExtImport, | ||
autoConnect :: Maybe Bool | ||
} | ||
deriving (Show, Eq, Data) | ||
deriving (Show, Eq, Data, Generic, FromJSON) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.