-
Notifications
You must be signed in to change notification settings - Fork 44
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
Unit tests to illustrate issue #39 #40
Conversation
…oblem and two pass already and only exist as regression tests
… a property instead of a string[] that is being directly deserialised to; again two tests that fail to illustrate the problem and two that pass to act as regression tests When the code is updated to fix the problem in the previous changeset, I'm sure that it will fix these as well but I thought that it made sense to include a few extra cases
I've fixed the tests - I commented one out as I think there is no way to support that (the information is just not available via reflection). What do you think? |
I think that it's a mistake to comment out the test because it's a valid use case. Unfortunately, you are correct that the information does not appear to be available in meta data via the normal forms of reflection but it is in there - I have just struggled so far to get it out! It might be interesting to know that the project PublicApiGenerator can make the distinction but it uses Mono.Cecil to get the information out. I know that your project here requires zero dependencies, which is very attractive, but it should be feasible to look into the the Mono.Cecil library is doing and utilise the same logic. I started looking at this a few weeks ago but I got distracted by other things. The good news, then, is that this information is available - the bad news is that it's not yet clear how to get it out (though hopefully Cecil's source code can help with that!) |
Probably in PublicApiGenerator (as well as the NJS/NSwag schema generators) always reflect via property or method (return) parameter where you have this info. Here we only have the runtime type here. Maybe we can get the metadata via generic type on the method... |
When I looked into it, I got the distinct impression that the
PublicApiGenerator was also considering only runtime information. There are
some differences in the runtime meta data, I've just struggled to find out
how to read it. I found that if I used ildasm then I could see them but, as
I said, I hadn't worked out how to read them or how Mono.Cecil was able to
(though the answer surely lies in there).
I can try and see if I have any of my notes still available from when I
last looked into this.
…On Tue, 26 May 2020, 21:54 Rico Suter, ***@***.***> wrote:
Probably in PublicApiGenerator (as well as the NJS/NSwag schema
generators) always reflect via property or method (return) parameter where
you have this info. Here we only have the runtime type here. Maybe we can
get the metadata via generic type on the method...
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#40 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVHTFQNXFZZJ2NOH4EBGDRTQUBTANCNFSM4MHHFT3A>
.
|
I merged this for now, the missing test can be fixed later... but as i said i dont know whether this is even possible. |
Tests created to try to explain myself better in relation to issue #39 (and to offer some regression tests as well as failure cases).