Skip to content

Generalise over the Swagger datatype.#142

Open
sorki wants to merge 1 commit into
haskell-servant:masterfrom
sorki:poly2026
Open

Generalise over the Swagger datatype.#142
sorki wants to merge 1 commit into
haskell-servant:masterfrom
sorki:poly2026

Conversation

@sorki

@sorki sorki commented May 16, 2026

Copy link
Copy Markdown

This change modifies the previously introduced generalisation of the Haskell datatype that holds the Swagger specification to an aeson Value.

By using an aeson Value, all ordering information of object fields is being lost. This information is in principle preserved by aeson, when going via Encoding rather than Value.

With this patch, we do not perform any aeson-related translation in the servant-swagger-ui code, and simply use the original datatype. It is servant's own responsibility to handle the actual conversion of the datatype to JSON.

Follow-up to #89 and #92.

This change modifies the previously introduced generalisation of the
Haskell datatype that holds the Swagger specification to an aeson Value.

By using an aeson Value, all ordering information of object fields is
being lost. This information is in principle preserved by aeson, when
going via Encoding rather than Value.

With this patch, we do not perform any aeson-related translation in the
servant-swagger-ui code, and simply use the original datatype. It is
servant's own responsibility to handle the actual conversion of the
datatype to JSON.

Follow-up to haskell-servant#89.

Co-Authored-By: srk <srk@48.io>
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.

2 participants