-
Notifications
You must be signed in to change notification settings - Fork 117
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
Actix plugin: add an empty impl for actix-web ReqData #315
Actix plugin: add an empty impl for actix-web ReqData #315
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems ok to me. Could you please add a test case?
@tiagolobocastro Would something like ca943e6 do the trick? |
Yes indeed 👍 |
@dsferruzza, they don't look like they're caused by your changes, but do you mind fixing the build failures? |
@tiagolobocastro There are 2 "easy-to-fix" issues, but I'd like your opinion:
Shall I proceed like I said? |
@dsferruzza that sounds good |
@tiagolobocastro There is something weird about item number 2: my "fix" on |
That's very odd, sadly doesn't seem to happen on my box :/ Could you undo the change, and print the contents of data in |
I tracked down the bug to the codegen module: the
At this point, I cannot think of a way to fix both tests (stable and nightly) without doing a dirty hack (re-implementing escaping, doing
|
Good catch! It'd be great if you can confirm that codegen is broken on stable (https://paperclip.waffles.space/cli.html) and raise a ticket for it |
Using Codegen seems to work if I put single quotes in my definition file (pet-v2-single-quotes.yaml.txt). The part that fails in the test is related to the I believe it gets called at some point when this code is executed from the faulty test ( static K8S_SCHEMA: Lazy<ResolvableApi<K8sSchema>> = Lazy::new(|| {
let fd = File::open(ROOT.join("tests/k8s-v1.16.0-alpha.0-openapi-v2.json")).expect("file?");
let raw: ResolvableApi<K8sSchema> = v2::from_reader(fd).expect("deserializing spec");
raw.resolve().expect("resolution")
});
// [...]
static CODEGEN_K8S_CLI: Lazy<()> = Lazy::new(|| {
let mut state = EmitterState::default();
state.working_dir = (&*ROOT).into();
state.working_dir.push("tests/test_k8s/cli");
let mut meta = CrateMeta::default();
assert_eq!(meta.mode, EmitMode::Module);
meta.name = Some("test-k8s-cli".into());
meta.version = Some("0.0.0".into());
meta.authors = Some(vec!["Me <[email protected]>".into()]);
meta.mode = EmitMode::App;
state.set_meta(meta);
let emitter = DefaultEmitter::from(state);
emitter.generate(&K8S_SCHEMA).expect("codegen");
}); |
@tiagolobocastro I guess the build is fixed! Does it seem acceptable to you? |
Nice one, seems reasonable to me. Would you mind rebasing your 4 "fix ***" commits into a single one? |
88be2a9
to
014f8fe
Compare
Done! |
Hi!
I tried to fix #300 and it seems to work!
(I tested it locally on a project that uses paperclip.)
Could someone review this, please?