-
Notifications
You must be signed in to change notification settings - Fork 30
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 more snippets concerning maps and enum casing. #1660
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
andrueastman
previously approved these changes
Jul 10, 2023
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.
👍🏼
@@ -338,45 +338,62 @@ private static void WriteMapValue(StringBuilder payloadSb, string propertyAssign | |||
if (parent.PropertyType == PropertyType.Object) | |||
payloadSb.AppendLine( | |||
$"${propertyAssignment}->set{EscapePropertyNameForSetterAndGetter(currentProperty.Name)}(${EscapePropertyNameForSetterAndGetter(currentProperty.Name).ToFirstCharacterLowerCase()});"); | |||
if(!fromMap) payloadSb.AppendLine(); | |||
if (parent.PropertyType == PropertyType.Array) indentManager.Unindent(); | |||
if(!fromMap && parent.PropertyType != PropertyType.Array) payloadSb.AppendLine(); |
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.
Suggested change
if(!fromMap && parent.PropertyType != PropertyType.Array) payloadSb.AppendLine(); | |
else if(!fromMap) payloadSb.AppendLine(); |
Looks like its mutually exclusive here
CodeSnippetsReflection.OpenAPI/LanguageGenerators/PhpGenerator.cs
Outdated
Show resolved
Hide resolved
CodeSnippetsReflection.OpenAPI/LanguageGenerators/PhpGenerator.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Eastman <andrueastman@users.noreply.github.com>
Co-authored-by: Eastman <andrueastman@users.noreply.github.com>
Kudos, SonarCloud Quality Gate passed! |
Hi @andrueastman, kindly recheck the PR. |
andrueastman
approved these changes
Jul 17, 2023
SilasKenneth
added a commit
that referenced
this pull request
Jul 18, 2023
* Bump apidoctor from `927ac29` to `ce76ead` (#1656) Bumps [apidoctor](https://github.com/OneDrive/apidoctor) from `927ac29` to `ce76ead`. - [Commits](OneDrive/apidoctor@927ac29...ce76ead) --- updated-dependencies: - dependency-name: apidoctor dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fixes type names in collection initializers (#1657) * Fixes reserved type escaping in collections * Revert * Fix snippets * Bump xunit.runner.visualstudio from 2.4.5 to 2.5.0 (#1659) Bumps [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit) from 2.4.5 to 2.5.0. - [Release notes](https://github.com/xunit/visualstudio.xunit/releases) - [Commits](xunit/visualstudio.xunit@v2.4.5...2.5.0) --- updated-dependencies: - dependency-name: xunit.runner.visualstudio dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix PHP Snippets. (#1655) * Fix issue with setting Odata types and OdataID * Update the tests * Change DateTime instantiation. * Fix how array of enums are represented. * Remove unused variable. * Fix path parameter rendering. * Remove unused imports. * Fix indexer method name. * Fix escaping reserved keywords in types. * Bump xunit from 2.4.2 to 2.5.0 (#1658) * Bump xunit from 2.4.2 to 2.5.0 Bumps [xunit](https://github.com/xunit/xunit) from 2.4.2 to 2.5.0. - [Commits](xunit/xunit@2.4.2...2.5.0) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Fixes test signature --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Andrew Omondi <andrew.omondi@microsoft.com> * Bump Microsoft.AspNetCore.Authorization from 7.0.8 to 7.0.9 (#1662) Bumps [Microsoft.AspNetCore.Authorization](https://github.com/dotnet/aspnetcore) from 7.0.8 to 7.0.9. - [Release notes](https://github.com/dotnet/aspnetcore/releases) - [Changelog](https://github.com/dotnet/aspnetcore/blob/main/docs/ReleasePlanning.md) - [Commits](dotnet/aspnetcore@v7.0.8...v7.0.9) --- updated-dependencies: - dependency-name: Microsoft.AspNetCore.Authorization dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump Microsoft.AspNetCore.Mvc.NewtonsoftJson from 7.0.8 to 7.0.9 (#1661) Bumps [Microsoft.AspNetCore.Mvc.NewtonsoftJson](https://github.com/dotnet/aspnetcore) from 7.0.8 to 7.0.9. - [Release notes](https://github.com/dotnet/aspnetcore/releases) - [Changelog](https://github.com/dotnet/aspnetcore/blob/main/docs/ReleasePlanning.md) - [Commits](dotnet/aspnetcore@v7.0.8...v7.0.9) --- updated-dependencies: - dependency-name: Microsoft.AspNetCore.Mvc.NewtonsoftJson dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump Microsoft.AspNetCore.Authentication.JwtBearer from 7.0.8 to 7.0.9 (#1663) Bumps [Microsoft.AspNetCore.Authentication.JwtBearer](https://github.com/dotnet/aspnetcore) from 7.0.8 to 7.0.9. - [Release notes](https://github.com/dotnet/aspnetcore/releases) - [Changelog](https://github.com/dotnet/aspnetcore/blob/main/docs/ReleasePlanning.md) - [Commits](dotnet/aspnetcore@v7.0.8...v7.0.9) --- updated-dependencies: - dependency-name: Microsoft.AspNetCore.Authentication.JwtBearer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump Microsoft.VisualStudio.Web.CodeGeneration.Design (#1664) Bumps [Microsoft.VisualStudio.Web.CodeGeneration.Design](https://github.com/dotnet/Scaffolding) from 7.0.7 to 7.0.8. - [Release notes](https://github.com/dotnet/Scaffolding/releases) - [Commits](https://github.com/dotnet/Scaffolding/commits) --- updated-dependencies: - dependency-name: Microsoft.VisualStudio.Web.CodeGeneration.Design dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump MSTest.TestFramework from 3.0.4 to 3.1.1 (#1666) Bumps [MSTest.TestFramework](https://github.com/microsoft/testfx) from 3.0.4 to 3.1.1. - [Release notes](https://github.com/microsoft/testfx/releases) - [Changelog](https://github.com/microsoft/testfx/blob/main/docs/Changelog.md) - [Commits](microsoft/testfx@v3.0.4...v3.1.1) --- updated-dependencies: - dependency-name: MSTest.TestFramework dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix more snippets concerning maps and enum casing. (#1660) * Fix issue with setting Odata types and OdataID * Update the tests * Change DateTime instantiation. * Fix how array of enums are represented. * Remove unused variable. * Fix path parameter rendering. * Remove unused imports. * Fix indexer method name. * Fix escaping reserved keywords in types. * Fix issue with enums and maps. * Use unused parameter. * Fix enum value casing. * Fix issue with objects inside array or maps. * Update CodeSnippetsReflection.OpenAPI/LanguageGenerators/PhpGenerator.cs Co-authored-by: Eastman <andrueastman@users.noreply.github.com> * Update CodeSnippetsReflection.OpenAPI/LanguageGenerators/PhpGenerator.cs Co-authored-by: Eastman <andrueastman@users.noreply.github.com> * Fix failing tests after review. --------- Co-authored-by: Eastman <andrueastman@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Eastman <andrueastman@users.noreply.github.com> Co-authored-by: Andrew Omondi <andrew.omondi@microsoft.com>
millicentachieng
added a commit
that referenced
this pull request
Jul 27, 2023
* Merge latest changes from Dev (#1668) * Bump apidoctor from `927ac29` to `ce76ead` (#1656) Bumps [apidoctor](https://github.com/OneDrive/apidoctor) from `927ac29` to `ce76ead`. - [Commits](OneDrive/apidoctor@927ac29...ce76ead) --- updated-dependencies: - dependency-name: apidoctor dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fixes type names in collection initializers (#1657) * Fixes reserved type escaping in collections * Revert * Fix snippets * Bump xunit.runner.visualstudio from 2.4.5 to 2.5.0 (#1659) Bumps [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit) from 2.4.5 to 2.5.0. - [Release notes](https://github.com/xunit/visualstudio.xunit/releases) - [Commits](xunit/visualstudio.xunit@v2.4.5...2.5.0) --- updated-dependencies: - dependency-name: xunit.runner.visualstudio dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix PHP Snippets. (#1655) * Fix issue with setting Odata types and OdataID * Update the tests * Change DateTime instantiation. * Fix how array of enums are represented. * Remove unused variable. * Fix path parameter rendering. * Remove unused imports. * Fix indexer method name. * Fix escaping reserved keywords in types. * Bump xunit from 2.4.2 to 2.5.0 (#1658) * Bump xunit from 2.4.2 to 2.5.0 Bumps [xunit](https://github.com/xunit/xunit) from 2.4.2 to 2.5.0. - [Commits](xunit/xunit@2.4.2...2.5.0) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Fixes test signature --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Andrew Omondi <andrew.omondi@microsoft.com> * Bump Microsoft.AspNetCore.Authorization from 7.0.8 to 7.0.9 (#1662) Bumps [Microsoft.AspNetCore.Authorization](https://github.com/dotnet/aspnetcore) from 7.0.8 to 7.0.9. - [Release notes](https://github.com/dotnet/aspnetcore/releases) - [Changelog](https://github.com/dotnet/aspnetcore/blob/main/docs/ReleasePlanning.md) - [Commits](dotnet/aspnetcore@v7.0.8...v7.0.9) --- updated-dependencies: - dependency-name: Microsoft.AspNetCore.Authorization dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump Microsoft.AspNetCore.Mvc.NewtonsoftJson from 7.0.8 to 7.0.9 (#1661) Bumps [Microsoft.AspNetCore.Mvc.NewtonsoftJson](https://github.com/dotnet/aspnetcore) from 7.0.8 to 7.0.9. - [Release notes](https://github.com/dotnet/aspnetcore/releases) - [Changelog](https://github.com/dotnet/aspnetcore/blob/main/docs/ReleasePlanning.md) - [Commits](dotnet/aspnetcore@v7.0.8...v7.0.9) --- updated-dependencies: - dependency-name: Microsoft.AspNetCore.Mvc.NewtonsoftJson dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump Microsoft.AspNetCore.Authentication.JwtBearer from 7.0.8 to 7.0.9 (#1663) Bumps [Microsoft.AspNetCore.Authentication.JwtBearer](https://github.com/dotnet/aspnetcore) from 7.0.8 to 7.0.9. - [Release notes](https://github.com/dotnet/aspnetcore/releases) - [Changelog](https://github.com/dotnet/aspnetcore/blob/main/docs/ReleasePlanning.md) - [Commits](dotnet/aspnetcore@v7.0.8...v7.0.9) --- updated-dependencies: - dependency-name: Microsoft.AspNetCore.Authentication.JwtBearer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump Microsoft.VisualStudio.Web.CodeGeneration.Design (#1664) Bumps [Microsoft.VisualStudio.Web.CodeGeneration.Design](https://github.com/dotnet/Scaffolding) from 7.0.7 to 7.0.8. - [Release notes](https://github.com/dotnet/Scaffolding/releases) - [Commits](https://github.com/dotnet/Scaffolding/commits) --- updated-dependencies: - dependency-name: Microsoft.VisualStudio.Web.CodeGeneration.Design dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump MSTest.TestFramework from 3.0.4 to 3.1.1 (#1666) Bumps [MSTest.TestFramework](https://github.com/microsoft/testfx) from 3.0.4 to 3.1.1. - [Release notes](https://github.com/microsoft/testfx/releases) - [Changelog](https://github.com/microsoft/testfx/blob/main/docs/Changelog.md) - [Commits](microsoft/testfx@v3.0.4...v3.1.1) --- updated-dependencies: - dependency-name: MSTest.TestFramework dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix more snippets concerning maps and enum casing. (#1660) * Fix issue with setting Odata types and OdataID * Update the tests * Change DateTime instantiation. * Fix how array of enums are represented. * Remove unused variable. * Fix path parameter rendering. * Remove unused imports. * Fix indexer method name. * Fix escaping reserved keywords in types. * Fix issue with enums and maps. * Use unused parameter. * Fix enum value casing. * Fix issue with objects inside array or maps. * Update CodeSnippetsReflection.OpenAPI/LanguageGenerators/PhpGenerator.cs Co-authored-by: Eastman <andrueastman@users.noreply.github.com> * Update CodeSnippetsReflection.OpenAPI/LanguageGenerators/PhpGenerator.cs Co-authored-by: Eastman <andrueastman@users.noreply.github.com> * Fix failing tests after review. --------- Co-authored-by: Eastman <andrueastman@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Eastman <andrueastman@users.noreply.github.com> Co-authored-by: Andrew Omondi <andrew.omondi@microsoft.com> * Bump apidoctor from `ab6e5c3` to `b1ac82e` (#1674) (#1682) Bumps [apidoctor](https://github.com/OneDrive/apidoctor) from `ab6e5c3` to `b1ac82e`. - [Commits](OneDrive/apidoctor@ab6e5c3...b1ac82e) --- updated-dependencies: - dependency-name: apidoctor dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Eastman <andrueastman@users.noreply.github.com> Co-authored-by: silaskenneth <silaskenneth1@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Andrew Omondi <andrew.omondi@microsoft.com> Co-authored-by: Faith Kangai <fey101@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Brief description of what this PR does, and why it is needed.
Demo
Optional. Screenshots,
curl
examples, etc.Notes
Optional. Ancillary topics, caveats, alternative strategies that didn't work out, anything else.
Testing Instructions