Skip to content

Adds Fleece request and response support #10

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

Merged
merged 2 commits into from
Apr 7, 2025
Merged

Conversation

AugmenTab
Copy link
Contributor

We've tried to avoid forcing users to use Fleece, but the fact of the matter is that without Fleece, we cannot generate the OpenAPI spec. So, this commit does two things:

  1. Adds schema-specific constructors and handlers for RequestBody and ResponseBody.

  2. Adds schema-specific response builder functions. They now use a dedicated function addResponseSchema to build them, which itself sets the content type as application/json.

We've tried to avoid forcing users to use Fleece, but the fact of
the matter is that without Fleece, we cannot generate the OpenAPI
spec. So, this commit does two things:

1. Adds schema-specific constructors and handlers for `RequestBody`
and `ResponseBody`.

2. Adds schema-specific response builder functions. They now use a
dedicated function `addResponseSchema` to build them, which itself
sets the content type as `application/json`.
@@ -85,7 +87,11 @@ data NoRequestBody
= NoRequestBody

data RequestBody body tags where
RequestBody ::
RequestSchema ::
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we actually need this to be a separate constructor? I think we can do this by having an orb-fleece that wraps around orb to get this, and the other functionality, back.

Copy link
Contributor Author

@AugmenTab AugmenTab Apr 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

requestBody takes this type, so I don't see how we could do that without it just being a re-implementation of orb. Can you walk me through what you're thinking?

Copy link
Contributor

@telser telser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After talking, I think we have options on a path forward, but let's get this in to keep moving right now.

@AugmenTab AugmenTab merged commit 1be13a4 into main Apr 7, 2025
1 check passed
@AugmenTab AugmenTab deleted the tbaum/fleece-body branch August 15, 2025 14:00
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