Skip to content

Commit 5a8b608

Browse files
committed
Remove deprecated code
1 parent f1da80d commit 5a8b608

File tree

5 files changed

+17
-692
lines changed

5 files changed

+17
-692
lines changed

compiler/src/model/metamodel.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,9 @@ export class Property {
126126
description?: string
127127
docUrl?: string
128128
docId?: string
129-
since?: string
130129
serverDefault?: boolean | string | number | string[] | number[]
131130
deprecation?: Deprecation
132131
availability?: Availabilities
133-
stability?: Stability
134132
/**
135133
* If specified takes precedence over `name` when generating code. `name` is always the value
136134
* to be sent over the wire
@@ -226,7 +224,7 @@ export class Interface extends BaseType {
226224
*/
227225
generics?: TypeName[]
228226
inherits?: Inherits
229-
implements?: Inherits[]
227+
implements?: Inherits[] // Unused!
230228

231229
/**
232230
* Behaviors directly implemented by this interface
@@ -333,7 +331,6 @@ export class EnumMember {
333331
codegenName?: string
334332
description?: string
335333
deprecation?: Deprecation
336-
since?: string
337334
availability?: Availabilities
338335
}
339336

@@ -415,14 +412,6 @@ export class Endpoint {
415412

416413
urls: UrlTemplate[]
417414

418-
/**
419-
* The version when this endpoint reached its current stability level.
420-
* Missing data means "forever", i.e. before any of the target client versions produced from this spec.
421-
*/
422-
since?: string
423-
stability?: Stability
424-
visibility?: Visibility
425-
featureFlag?: string
426415
requestMediaType?: string[]
427416
responseMediaType?: string[]
428417
privileges?: {

compiler/src/model/utils.ts

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -669,22 +669,6 @@ export function hoistRequestAnnotations (
669669
// Apply the availabilities to the Endpoint.
670670
for (const [availabilityName, availabilityValue] of Object.entries(availabilities)) {
671671
endpoint.availability[availabilityName] = availabilityValue
672-
673-
// Backfilling deprecated fields on an endpoint.
674-
if (availabilityName === 'stack') {
675-
if (availabilityValue.since !== undefined) {
676-
endpoint.since = availabilityValue.since
677-
}
678-
if (availabilityValue.stability !== undefined) {
679-
endpoint.stability = availabilityValue.stability
680-
}
681-
if (availabilityValue.visibility !== undefined) {
682-
endpoint.visibility = availabilityValue.visibility
683-
}
684-
if (availabilityValue.featureFlag !== undefined) {
685-
endpoint.featureFlag = availabilityValue.featureFlag
686-
}
687-
}
688672
}
689673
} else {
690674
assert(jsDocs, false, `Unhandled tag: '${tag}' with value: '${value}' on request ${request.name.name}`)
@@ -787,16 +771,6 @@ function hoistPropertyAnnotations (property: model.Property, jsDocs: JSDoc[]): v
787771
property.availability = {}
788772
for (const [availabilityName, availabilityValue] of Object.entries(availabilities)) {
789773
property.availability[availabilityName] = availabilityValue
790-
791-
// Backfilling deprecated fields on a property.
792-
if (availabilityName === 'stack') {
793-
if (availabilityValue.since !== undefined) {
794-
property.since = availabilityValue.since
795-
}
796-
if (availabilityValue.stability !== undefined) {
797-
property.stability = availabilityValue.stability
798-
}
799-
}
800774
}
801775
} else if (tag === 'doc_id') {
802776
assert(jsDocs, value.trim() !== '', `Property ${property.name}'s @doc_id is cannot be empty`)
@@ -898,13 +872,6 @@ function hoistEnumMemberAnnotations (member: model.EnumMember, jsDocs: JSDoc[]):
898872
member.availability = {}
899873
for (const [availabilityName, availabilityValue] of Object.entries(availabilities)) {
900874
member.availability[availabilityName] = availabilityValue
901-
902-
// Backfilling deprecated fields on a property.
903-
if (availabilityName === 'stack') {
904-
if (availabilityValue.since !== undefined) {
905-
member.since = availabilityValue.since
906-
}
907-
}
908875
}
909876
} else {
910877
assert(jsDocs, false, `Unhandled tag: '${tag}' with value: '${value}' on enum member ${member.name}`)

compiler/test/request-availability/test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,4 @@ test('Request @availability can fulfill all the fields', t => {
3535
stack: { stability: 'beta', visibility: 'feature_flag', featureFlag: 'abc', since: '1.2.3' },
3636
serverless: { visibility: 'private', stability: 'experimental' }
3737
});
38-
// Assert backfilled values are correct
39-
t.true(endpoint?.visibility === 'feature_flag');
40-
t.true(endpoint?.stability === 'beta');
41-
t.true(endpoint?.featureFlag === 'abc');
42-
t.true(endpoint?.since === '1.2.3');
4338
})

0 commit comments

Comments
 (0)