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

Fix for File Parameter interface not generated in some instances #2972

Merged

Conversation

craigngu
Copy link
Contributor

@craigngu craigngu commented Jul 31, 2020

  • Split the Binary tests into 3 so each endpoint can be generated properly without missing the FileParameter interface
  • changed RequiresFileParameterInterface logic so it checks isBinary on arrays and nested objects

Fixes #2973

- Split the Binary tests into 3 so each endpoint can be generated properly without missing the FileParameter interface
- changed RequiresFileParameterInterface logic so it checks isBinary on arrays and nested objects
@jeremyVignelles
Copy link
Collaborator

Do you know which issues are fixed by this PR? I've seen a lot of FileParameter-related issues lately

@craigngu
Copy link
Contributor Author

For this PR its trying to fix the issue that the FileParameter interface in Typescript generated clients are missing when

  1. There are no endpoints that have a single file input

So What I did is to check one layer deeper for the isBinary tags so now it will appear when there are

  1. Array of files
  2. File input under a nested structure

Check the unit tests I've changed for examples,
the original unit test combined all 3 use cases in one test, but the second and third endpoint won't work properly without the first one existing.

@jeremyVignelles
Copy link
Collaborator

I mean, please link the issues resolved by your PR in the PR description like Fixes #.

@craigngu
Copy link
Contributor Author

I can create an issue for this, couldn't find any that matches this

@jeremyVignelles
Copy link
Collaborator

#2950 ?
#2259 ?
#2797 ?

Just looked at the title, don't know if it's really related, I'm on mobile.

@jeremyVignelles
Copy link
Collaborator

Your fix seems typescript specific, but would it be possible to include a fix for other issues as well?

@craigngu
Copy link
Contributor Author

yeah my fix is typescript specific for my use case, non of the ones referenced above are really related.

I don't think I understand the other issues fully atm, and its pretty different to how we were using it on the controller side

@RicoSuter RicoSuter merged commit 0acad7d into RicoSuter:master Aug 3, 2020
@RicoSuter
Copy link
Owner

Thanks for the PR.

RicoSuter added a commit that referenced this pull request Aug 3, 2020
* Add support for using controllers' summary as tag description (#2949)

* Add support for using controllers' summary as tag description

* Ensure tag only added to document if there's description

* Cleanup

* Move code

Co-authored-by: Rico Suter <mail@rsuter.com>

* Fix contract, closes #2933

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Bump elliptic from 6.4.0 to 6.5.3 in /src/NSwag.Sample.NetCoreAngular (#2968)

Bumps [elliptic](https://github.com/indutny/elliptic) from 6.4.0 to 6.5.3.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](indutny/elliptic@v6.4.0...v6.5.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix for File Parameter interface not generated in some instances (#2972)

- Split the Binary tests into 3 so each endpoint can be generated properly without missing the FileParameter interface
- changed RequiresFileParameterInterface logic so it checks isBinary on arrays and nested objects

Co-authored-by: Craig Ngu <Craig.Ngu@globalx.com.au>

* Correct link in markdown for MS Build Targets (#2958)

* Aligned OpenAPI code generation for file more with open API specification (#2896)

* Reworked C# client response handling (#2959)

* Reworked C# client response handling

* Disallowed null responses if the response type is not declared as nullable

Fixed the remark in #2944

* Fixed nullability on File I/O

* Fixed nullability on ConvertToString

* Fixed PR remarks

* Avoid nullability issues in Query parameters

Addresses RicoSuter/NJsonSchema#1069 (comment)

* Fixed invalid code if array value type is not string

* v13.7.0 (#2978)

* v13.7.0

* Fix test

Co-authored-by: Leon V <leon99@outlook.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: craigngu <42369784+craigngu@users.noreply.github.com>
Co-authored-by: Craig Ngu <Craig.Ngu@globalx.com.au>
Co-authored-by: Jedidiah May <33727409+portlandtn@users.noreply.github.com>
Co-authored-by: Nicolas Fløysvik <nico-floysvik@hotmail.com>
Co-authored-by: Jérémy VIGNELLES <jeremyVignelles@users.noreply.github.com>
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.

Typescript generated client does not include FileParameter when its in an Array
3 participants