23 Commits

Author SHA1 Message Date
William Cheng
36cb3ce6b9
add tests, workflow for haskell samples (#16290) 2023-08-10 10:42:57 +08:00
Masahiro Sakai
45d8027bb4
[haskell-servant][haskell-yesod] Use table-based conversion for field name conversion (#16232)
* [haskell-servant][haskell-yesod] use table-based conversion for field name conversion

Current fieldLabelModifier implementation always produces uncapitalize
name, but it is inappropriate if the original JSON field name begins
with a capital letter.

* [haskell-servant][haskell-yesod] regenerate samples
2023-08-03 13:29:33 +08:00
Masahiro Sakai
f6a819686d
[haskell][haskell-yesod] Fix special char replacements (#16197)
* [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
2023-07-28 09:35:46 +08:00
Tom Bärwinkel
f2321a61d3
Include response headers in the API type (#13565) 2022-12-06 23:48:29 +08:00
Nathan Baulch
9f1fa0e440
Fix another batch of spelling typos (#13915)
* Fix typos

* Remove repeated words

* Minor grammar fixes
2022-11-07 21:30:24 +08:00
William Cheng
244a459836 update samples 2022-07-12 00:15:58 +08:00
Tom Bärwinkel
728c80abea
Add option to use custom a monad (#12618) 2022-07-07 01:13:06 +08:00
Tom Bärwinkel
54dca39459
Add authentication for haskell-servant (#12470)
* Add authentication for haskell-servant

* Add BearerToken to HaskellServantCodegen.java
2022-05-26 23:44:13 +08:00
William Cheng
4ee5f72214
Use LinkedHashMap for deterministic iteration order (#12230)
* to LinkedHashMap

* LinkedHashMap

* allModels to LinkedHaskMap

Co-authored-by: yilinwang <linda.yilin@gmail.com>
2022-04-25 13:33:24 +08:00
William Cheng
1d934643fd update samples 2021-09-23 14:29:33 +08:00
Nathan Baulch
5d68bd6a03
Fix thousands of spelling typos (#10272) 2021-08-28 22:58:24 +08:00
William Cheng
79866e90cf update haskell servant samples 2021-07-13 21:03:07 +08:00
William Cheng
919945b65b
ensure haskell, erlang server samles up-to-date (#9851) 2021-06-26 18:53:07 +08:00
William Cheng
45175f018b update haskell-servant samples 2021-06-14 17:01:26 +08:00
Fjolnir-Dvorak
23479b30e4 [FIX][Haskell-servant] missing indent on the new feature pull request. (#4490)
* missing indent on the new feature pull request.

* One indentation to much

* Import for application was still missing

* some middleware got in the runServer name
2019-11-20 11:40:19 +08:00
Fjolnir-Dvorak
d624b28c96 [FEATURE][Haskell] Haskell-Servant serves static files (#4058)
* updated the golden files for haskell to be able to generate against those

* Haskell-servant now serves static files which are in a directory called "static"

* I missed to regenerate the docs directory
2019-10-30 20:47:53 -05:00
Fjolnir-Dvorak
4958ad74e7 [FEATURE][Haskell] Add Middleware support for the haskell servant generator (#4056)
* updated the golden files for haskell to be able to generate against those

* Added support for middlewares in the haskell servant generator.

* Renamed runOpenAPIPetstoreServer to runOpenAPIPetstoreMiddlewareServer and added a backwards compability version runOpenAPIPetstoreServer using requestMiddlewareId as middleware.
2019-10-30 20:47:35 -05:00
Fabrizio Ferrai
48314905da [Haskell-Servant] Upgrade to Servant 0.16 (#2849) 2019-05-11 11:08:53 +08:00
Fabrizio Ferrai
0ef579363d [haskell-servant] Fix parsing of special characters (#2676) 2019-05-09 15:08:51 +08:00
Fabrizio Ferrai
250e5284cd [haskell-servant] Add some missing types to the generated modules (#2675)
* Add some missing types to the generated modules

* Run bin/openapi3 script
2019-05-04 17:05:15 -05:00
Stefan Dresselhaus
ae376c151b Something in the dependencies changed. This switch is no longer needed. (#1850) 2019-02-20 15:25:11 +08:00
Fabrizio Ferrai
6976a8c775 Upgrade haskell-servant generator to latest LTS (#1469)
* [Haskell Servant] Upgrade to lts-12

- Upgrade Servant to the latest version
- Add Maybe for optional values
- Add UUID, UTCTime and Day types
- Fix the URL configuration so that it has one param with all data
- Add Data and ToSchema instances to models
- Switch to TLS http manager so it can connect to https urls
- Add nicer API to call the endpoints
- Add Nix support

* [Haskell Servant] Upgrade Petstore

* [Haskell Servant] Delete old swagger-petstore samples

* [Haskell Servant] Use generics for ToForm and FromForm instances

* [Haskell Servant] Generate ToSchema instance only if it's safe to do
2018-12-04 19:03:08 +08:00
Jérémie Bresson
059a3efe46 Regenerate samples (#367) 2018-05-08 16:44:51 +08:00