forked from loafle/openapi-generator-original
* [haskell][haskell-yesod] remove fixOperatorChars() fixOperatorChars() does not change input strings since special characters have already been replaced in DefaultCodegen.fromModel(). * [haskell][haskell-yesod] do not prefix with quote ("'") when generating removeFieldLabelPrefix table We switched from the conversion done by fixOperatorChars() to the conversion done by DefaultCodegen.fromModel() and the latter does not insert quote characters. So We modify the removeFieldLabelPrefix table to conform the new mapping. * [haskell][haskell-yesod] remove forParsing parameter from removeFieldLabelPrefix function Aeson's fieldLabelModifier always convert Haskell field names to JSON field names, whether at parse time or not. (Note that stripPrefix and uncapitalize do not take such parameter) * [haskell][haskell-yesod] perform replaceSpecialChars after stripping prefix Because replaceSpecialChars can corrupt prefix if the prefix contains a replacement string of a specfial character as a substring. * [haskell][haskell-yesod] regenerate samples
Haskell Setup
- If you haven't already, install Stack
- On POSIX systems, this is usually
curl -sSL https://get.haskellstack.org/ | sh
- On POSIX systems, this is usually
- Install the
yesod
command line tool:stack install yesod-bin --install-ghc
- Build libraries:
stack build
If you have trouble, refer to the Yesod Quickstart guide for additional detail.
Development
Start a development server with:
stack exec -- yesod devel
As your code changes, your site will be automatically recompiled and redeployed to localhost.
Tests
stack test --flag open-api-petstore:library-only --flag open-api-petstore:dev
(Because yesod devel
passes the library-only
and dev
flags, matching those flags means you don't need to recompile between tests and development, and it disables optimization to speed up your test compile times).
Documentation
- Read the Yesod Book online for free
- Check Stackage for documentation on the packages in your LTS Haskell version, or search it using Hoogle. Tip: Your LTS version is in your
stack.yaml
file. - For local documentation, use:
stack haddock --open
to generate Haddock documentation for your dependencies, and open that documentation in a browserstack hoogle <function, module or type signature>
to generate a Hoogle database and search for your query
- The Yesod cookbook has sample code for various needs
Getting Help
- Ask questions on Stack Overflow, using the Yesod or Haskell tags
- Ask the Yesod Google Group
- There are several chat rooms you can ask for help:
- For IRC, try Freenode#yesod and Freenode#haskell
- Functional Programming Slack, in the #haskell, #haskell-beginners, or #yesod channels.