Commit 2e78e17
fix(normalizer): support OAS 3.1 annotated enums (oneOf + const) for consistent enum generation (C#) (OpenAPITools#23869)
* fix(csharp): use numeric .NET version check to prevent double URL-encoding on .NET 9+
On .NET 9+, HttpUtility.ParseQueryString() already URL-encodes values internally.
The previous fix only checked for '.NET 9' literally, missing .NET 10+ (PowerShell 7.6).
Replace the string prefix check with a numeric major version comparison (>= 9) and
move the RuntimeInformation check outside the foreach loop to avoid redundant parsing.
Fixes: CSCwu08056
* Introducing Annotated Enum with const
* fix: support OpenAPI 3.1 const in annotated enum normalization
* fix(docs): use forward slashes in path separators for cross-platform portability
* revert: remove unrelated doc file changes from PR scope
* refactor(normalizer): extract definesEnum variable per reviewer suggestion
* fix(normalizer): preserve x-enum-deprecated for oneOf/anyOf const enums
* chore: regenerate samples after normalization improvements
* chore(samples): normalize generated samples for cross-platform output
* adding samples
* chore(csharp): sync HttpSigningConfiguration.mustache from upstream/master
* Revert "adding samples"
This reverts commit 6ef74e7.
* add annotated enum csharp config and regenerate samples
* Revert "add annotated enum csharp config and regenerate samples"
This reverts commit 5e4b895.
* add csharp generichost annotated enum config
* regenerate samples for csharp generichost annotated enum
* ci(csharp): add AnnotatedEnum sample to .NET 10 workflow
* chore(samples): regenerate AnnotatedEnum after upstream merge
* chore(samples): align AnnotatedEnum FILES manifest with double-regen convention
CI's samples job runs bin/generate-samples.sh twice. On the second pass the generator skips idempotent files (.openapi-generator-ignore and Test/{Api,Model}/*Tests.cs already on disk), so they are omitted from the FILES manifest. Other generichost samples (e.g. ComposedEnum) follow this convention; AnnotatedEnum's FILES was previously committed after a single regen and included 17 stale entries. Regenerated to match CI output.
---------
Co-authored-by: sagadira <sagadira@cisco.com>
Co-authored-by: Vikrant Balyan <vvb@users.noreply.github.com>1 parent dfdb6e6 commit 2e78e17
88 files changed
Lines changed: 7063 additions & 10 deletions
File tree
- .github/workflows
- bin/configs
- modules/openapi-generator/src
- main/java/org/openapitools/codegen
- test/java/org/openapitools/codegen
- samples/client/petstore/csharp/generichost/latest/AnnotatedEnum
- .openapi-generator
- api
- docs
- apis
- models
- scripts
- src
- Org.OpenAPITools.Test
- Api
- Model
- Org.OpenAPITools
- Api
- Client
- Extensions
- Model
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
Lines changed: 21 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1643 | 1643 | | |
1644 | 1644 | | |
1645 | 1645 | | |
| 1646 | + | |
1646 | 1647 | | |
1647 | 1648 | | |
1648 | 1649 | | |
| |||
1663 | 1664 | | |
1664 | 1665 | | |
1665 | 1666 | | |
1666 | | - | |
1667 | | - | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
1668 | 1670 | | |
1669 | 1671 | | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
1670 | 1676 | | |
1671 | 1677 | | |
1672 | 1678 | | |
| |||
1681 | 1687 | | |
1682 | 1688 | | |
1683 | 1689 | | |
| 1690 | + | |
1684 | 1691 | | |
1685 | | - | |
| 1692 | + | |
1686 | 1693 | | |
1687 | 1694 | | |
1688 | 1695 | | |
1689 | 1696 | | |
1690 | 1697 | | |
1691 | 1698 | | |
1692 | 1699 | | |
1693 | | - | |
| 1700 | + | |
| 1701 | + | |
1694 | 1702 | | |
1695 | | - | |
| 1703 | + | |
1696 | 1704 | | |
| 1705 | + | |
1697 | 1706 | | |
1698 | 1707 | | |
1699 | 1708 | | |
1700 | 1709 | | |
1701 | 1710 | | |
1702 | | - | |
| 1711 | + | |
1703 | 1712 | | |
1704 | 1713 | | |
1705 | 1714 | | |
| |||
1708 | 1717 | | |
1709 | 1718 | | |
1710 | 1719 | | |
| 1720 | + | |
1711 | 1721 | | |
1712 | 1722 | | |
1713 | 1723 | | |
1714 | 1724 | | |
1715 | | - | |
| 1725 | + | |
1716 | 1726 | | |
1717 | 1727 | | |
1718 | 1728 | | |
| |||
1730 | 1740 | | |
1731 | 1741 | | |
1732 | 1742 | | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
1733 | 1747 | | |
1734 | 1748 | | |
1735 | 1749 | | |
| |||
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1568 | 1568 | | |
1569 | 1569 | | |
1570 | 1570 | | |
1571 | | - | |
1572 | | - | |
1573 | | - | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
1574 | 1581 | | |
1575 | 1582 | | |
1576 | 1583 | | |
| |||
0 commit comments