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

Fixes type names in collection initializers #1657

Merged
merged 3 commits into from
Jul 5, 2023

Conversation

andrueastman
Copy link
Member

PR fixes type names in collection initializers in generated snippet not being escaped using reserved names.

@andrueastman andrueastman requested a review from a team as a code owner July 5, 2023 10:30
@andrueastman andrueastman enabled auto-merge (squash) July 5, 2023 10:32
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 5, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

76.9% 76.9% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@andrueastman andrueastman merged commit 1c52b26 into dev Jul 5, 2023
@andrueastman andrueastman deleted the andrueastman/collectionEscaping branch July 5, 2023 10:41
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants