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

cope with and generate JMAP wrappers #30

Merged
merged 2 commits into from
Jan 16, 2018
Merged

Conversation

rjbs
Copy link
Member

@rjbs rjbs commented Jan 16, 2018

also, as_triple/s is now totally a thing

also, as_triple/s is now totally a thing
Copy link
Contributor

@mmcclimon mmcclimon left a comment

Choose a reason for hiding this comment

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

👍

for my $call (@$calls) {
my $request = _ARRAY0($input_request)
? { methodCalls => $input_request }
: { %$input_request };
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just use $input_request here?

(update: I guess you want to keep the original around to inspect later. Never mind, then!)

t/basic.t Outdated
[
jstr('atePies'),
{ howMany => jnum(100), tastiestPieId => jstr(123) },
jstr('a'),
],
"as_struct",
"as_triple",
Copy link
Contributor

Choose a reason for hiding this comment

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

or as_${triple_method}

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Copy link
Collaborator

@wolfsage wolfsage left a comment

Choose a reason for hiding this comment

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

Few nits, looks good though

@@ -205,7 +209,7 @@ L<JMAP::Tester::Response> objects.
=cut

sub request {
my ($self, $calls) = @_;
my ($self, $input_request, $arg) = @_;
Copy link
Collaborator

Choose a reason for hiding this comment

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

$arg is unused

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I meant to add a means to request/demand wrapping or not. I'll just drop it until then.

$request->{methodCalls} = \@suffixed;

$request = $request->{methodCalls}
if $ENV{JMAP_TESTER_NO_WRAPPER} && _ARRAY0($input_request);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't understand the _ARRAY0($input_request) here.

I suppose what we're saying is JMAP_TESTER_NO_WRAPPER means "Do not wrap old-style calls" but it does not mean "Unwrap new style calls".

Okay.


C<as_struct> returns an arrayref containing the result of calling C<as_struct>
on each sentence in the paragraph. C<as_stripped_struct> removes JSON types.
C<as_triples> returns an arrayref containing the result of calling C<as_triples>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Calls C<as_triple> on each sentence

Copy link
Member Author

Choose a reason for hiding this comment

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

Right!

@rjbs rjbs merged commit c133b61 into fastmail:master Jan 16, 2018
@rjbs rjbs deleted the wrappers-delight branch December 5, 2018 03:49
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