Skip to content
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

Restyle Fix query flag casing #20

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open

Restyle Fix query flag casing #20

wants to merge 24 commits into from

Conversation

restyled-io[bot]
Copy link

@restyled-io restyled-io bot commented Dec 29, 2020

A duplicate of #19 with additional commits that automatically address
incorrect style, created by Restyled.

Since the original Pull Request was opened as a fork in a contributor's
repository, we are unable to create a Pull Request branching from it with only
the style fixes.

The following Restylers made fixes:

  • rubocop
  • stylish-haskell

To incorporate these changes, you can either:

  1. Merge this Pull Request instead of the original, or

  2. Ask your contributor to locally incorporate these commits and push them to
    the original Pull Request

    Expand for example instructions
    ```console
    git remote add upstream https://github.com/joneshf/servant-ruby.git
    git fetch upstream pull/<this PR number>/head
    git merge --ff-only FETCH_HEAD
    git push
    ```
    

NOTE: As work continues on the original Pull Request, this process will
re-run and update (force-push) this Pull Request with updated style fixes as
necessary. If the style is fixed manually at any point (i.e. this process finds
no fixes to make), this Pull Request will be closed automatically.

Sorry if this was unexpected. To disable it, see our documentation.

stoeffel and others added 24 commits June 11, 2019 14:51
Creates space for other test suites in the `test` directory, such as the
golden test I'm about to add.
These test (and document) what code generation currently looks like for
various Servant API constructors.
Query flags are the Http equivalent of booleans. You can either set them
or you cannot. Currently the generated ruby code treats them as values:
You pass in a string and it gets added to the query string.

This ensures query flags in a servant API are modeled as booleans in the
generated ruby code.
When adding a query flag to an existing endpoint it would be nice if
this were a backwards-compatible change. From the HTTP perspective it
already is: the query flag is an optional element of the URI that can be
omitted. But code generation produces a non-optional argument. This
imposes a hard order-of-deploy between the service that supports the new
parameter and the client that makes use of it (or not).

This changes the code so the query flag is an optional argument in ruby
generated code. That way the backwards-compatibility of adding a query
parameter to an API is preserved into our generated code.
We weren't using the snake-cased variable name for a query flag in all
the places we were using the query flag.
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.

None yet

3 participants