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

Generate http request body in Atgen #21

Merged
merged 3 commits into from
Sep 3, 2019

Conversation

p1ass
Copy link
Contributor

@p1ass p1ass commented Sep 3, 2019

Issue

Close #17

What

HTTPのリクエストボディをAtgen内で行うように変更する。

lib/generator.go Outdated
err = errors.WithStack(internalErr)
return false
}
h, _ := parser.ParseExpr(fmt.Sprintf("%#v", body))
Copy link
Contributor

Choose a reason for hiding this comment

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

これだと前のリクエストの結果をつかって動的にリクエストを組み立てるということが出来なさそう?
(コード見る限り前も出来なかったのでは無いかという感じはあるけど
今後そういう事はやりたいと思っているので、atgen で構築した文字列を test codeを埋め込むのではなく、
json であれば json.Marshal するコードを埋め込むようにしたい。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

確かに。今の実装だとそれができなくなってしまいますね。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

json.Marshal を埋め込むように変更しました。

これだと前のリクエストの結果をつかって動的にリクエストを組み立てるということが出来なさそう?

こちらも組み立てられるようにし、確認用に実際のexampleも追加しました。

Copy link
Contributor

@sachaos sachaos left a comment

Choose a reason for hiding this comment

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

LGTM

@sachaos sachaos merged commit e95535f into aktsk:master Sep 3, 2019
@p1ass p1ass deleted the feature/generate-request-body-in-atgen branch September 3, 2019 05:10
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.

templateに記述しているリクエストボディの生成をatgen側でやるようにする
2 participants