Commit 27299b9
[http-client-csharp] Preserve shipped date-time property names (#11773)
## Summary
- preserve exact public GA property names when their date-time stems
match the current MTG-normalized property
- keep canonical MTG naming for new properties and when a GA name is
incompatible or already claimed
- keep customization suppression and canonical wire information
associated with the correct spec property across preserved names,
aliases, exact names, and refiltering
- cover historical, canonical, projected-provider, collision,
customization, and sibling-ownership scenarios
- normalize `ExpireTime` and `ExpireOn` to `ExpiresOn` for new APIs,
making `ExpireOn` and `ExpirationTime` share the semantic `Expires` stem
Fixes #11772
## Validation
- `dotnet test
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Microsoft.TypeSpec.Generator.Tests.csproj
--no-restore --filter
'FullyQualifiedName~PropertyProviderTests|FullyQualifiedName~ModelCustomizationTests|FullyQualifiedName~CSharpNameExtensionsTests'
-- NUnit.NumberOfTestWorkers=1`
---------
Co-authored-by: Jorge Rangel <jorgerangel@microsoft.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 0a5e8332-8ebe-44b1-97c5-44cc31caf25e1 parent f6897a6 commit 27299b9
46 files changed
Lines changed: 1559 additions & 67 deletions
File tree
- packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator
- src
- Providers
- test
- Providers
- ModelProviders
- TestData/ModelCustomizationTests
- CustomCodeRenameWithNameMatchingAnotherSpecPropertyDoesNotSuppressIt
- CustomCodeWithCanonicalNameReplacesPreservedProperty(Last)
- CustomCodeWithCanonicalNameReplacesPreservedProperty
- CustomCodeWithLastContractNamePreservesWireInfo(Last)
- CustomCodeWithLastContractNamePreservesWireInfo
- CustomCodeWithRawDateTimeNameReplacesNormalizedProperty
- CustomCodeWithSpecNameReplacesLastContractPreservedProperty(Last)
- CustomCodeWithSpecNameReplacesLastContractPreservedProperty
- DuplicateExactIdentifierCustomizationKeepsFirstSpecMatch
- ExactSpecNameTakesPrecedenceOverCanonicalAliasForCustomization(Last)
- ExactSpecNameTakesPrecedenceOverCanonicalAliasForCustomization
- HistoricalNameClaimedByCustomRenameIsNotReused(Last)
- HistoricalNameClaimedByCustomRenameIsNotReused
- HistoricalNameClaimedByRenamedCustomFieldIsNotReused(Last)
- HistoricalNameClaimedByRenamedCustomFieldIsNotReused
- RefilteringDoesNotUseStaleAliasToSuppressActiveProperty
- RefilteringPreservesCustomCodeSpecAssociation(Last)
- RefilteringPreservesCustomCodeSpecAssociation
- TestData/PropertyProviderTests
- TestDateTimeNameAlreadyEndingOnDoesNotUseHistoricalStemMatch
- TestPropertyNameDoesNotReuseCanonicalNameClaimedBySibling
- TestPropertyNameDoesNotReuseHistoricalNameClaimedByAnotherProperty
- TestPropertyNameDoesNotReuseHistoricalNameClaimedByNormalizedSibling
- TestPropertyNameIgnoresIncompatiblyTypedHistoricalName
- TestPropertyNamePrefersExactCanonicalNameFromLastContract
- TestPropertyNamePreservesCollisionSuffixedHistoricalName
- TestPropertyNamePreservesDateTimeNameFromProjectedProviderLastContract
- TestPropertyNamePreservesHistoricalDateTimeNamesFromLastContract
- TestPropertyNamePreservesHistoricalFirstAndLastDateTimeNames
- TestPropertyNamePreservesPreviouslyGeneratedDateTimeSuffixFromLastContract
- Utilities
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 28 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
| |||
92 | 96 | | |
93 | 97 | | |
94 | 98 | | |
| 99 | + | |
| 100 | + | |
95 | 101 | | |
| 102 | + | |
96 | 103 | | |
97 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
98 | 116 | | |
99 | 117 | | |
100 | 118 | | |
| |||
163 | 181 | | |
164 | 182 | | |
165 | 183 | | |
166 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
167 | 187 | | |
168 | 188 | | |
169 | 189 | | |
| |||
186 | 206 | | |
187 | 207 | | |
188 | 208 | | |
189 | | - | |
190 | | - | |
191 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
192 | 212 | | |
193 | 213 | | |
194 | 214 | | |
| |||
Lines changed: 124 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
| 106 | + | |
113 | 107 | | |
114 | | - | |
115 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
116 | 141 | | |
117 | | - | |
118 | | - | |
119 | | - | |
| 142 | + | |
120 | 143 | | |
121 | 144 | | |
122 | 145 | | |
| |||
180 | 203 | | |
181 | 204 | | |
182 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
183 | 295 | | |
184 | 296 | | |
185 | 297 | | |
| |||
0 commit comments