The Swift target-language layer for Skmtc generators (@skmtc/lang-swift). It covers the model, operation and Index base factories, SwiftSnippet, the register shape with module imports, the six identifier kinds, the project as one module, the head and value render model, access levels, names and keywords, inline types, and the producers for type bodies, properties, initializers, enum cases, functions and calls. Use ALONGSIDE skmtc-generator whenever a generator writes Swift.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Skmtc Lang Swift?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/skmtc-skmtc-lang-swift)
---
name: skmtc-lang-swift
version: 0.1.0
description: >
The Swift target-language layer for Skmtc generators
(@skmtc/lang-swift). It covers the model, operation and Index base
factories, SwiftSnippet, the register shape with module imports, the six
identifier kinds, the project as one module, the head and value render
model, access levels, names and keywords, inline types, and the
producers for type bodies, properties, initializers, enum cases,
functions and calls.
Use ALONGSIDE skmtc-generator whenever a generator writes Swift.
metadata:
internal: true
---
# The Swift layer (@skmtc/lang-swift)
Read `skmtc-generator` first. The worked examples are
`@skmtc/gen-swift-codable`, a model generator, and
`@skmtc/gen-swift-urlsession`, an operation generator that writes an SDK.
Generated code targets Swift 5.9 or later.
## 1. Declare the language
The import graph declares the language. `src/base.ts` imports a factory,
and each snippet extends `SwiftSnippet`. Import each module of the
package by its own path, never the package root.
```ts fragment
import { SwiftName } from '@skmtc/lang-swift/SwiftName'
import { toSwiftModelProjectionBase } from '@skmtc/lang-swift/toSwiftModelProjectionBase'
export const SwiftCodableBase = toSwiftModelProjectionBase<EnrichmentSchema>({
id: denoJson.name,
toIdentifierName({ ref }) {
return new SwiftName(toModelName(ref)).toType()
},
toIdentifierType: () => ({ type: 'typealias' }),
toExportPath({ ref, enrichments, variant }) {
return `@/${this.toIdentifierName({ ref, enrichments, variant })}.swift`
},
})
```
The package has three factories:
| Factory | For |
|---|---|
| `toSwiftModelProjectionBase` | One definition for each model |
| `toSwiftOasOperationProjectionBase` | One definition for each operation: a function in a file, or a member of an Index (`toIndex`) |
| `toSwiftOasOperationIndexBase` | A struct or a class that gets one member for each operation (section 9) |
## 2. The project is one module
Every file of a Swift module reads each type of the module with no
import, from any folder.
- **A reference to another file needs nothing.** The engine registers an
import for a definition in another file. `SwiftFile` renders nothing
for it.
- **Each name is in the whole module.** `toNameScope` gives one scope
for every file. Thus the engine gives a counter to the second model
that claims a name (`UserGroup2`). The engine does not know which
folders are one module, so it reads the project as one.
- **A model can hide a type that Swift declares.** A model named
`Error`, `Data` or `Date` hides that type in the whole module.
`swiftStandardTypes` lists them. Give such a model another name in
`base.ts` (`reservedNames` in `gen-swift-codable/src/base.ts`).
- **Two files of the module can declare one name, and the engine does
not see it.** A file knows its own definitions only. `swiftc` reports
`invalid redeclaration`.
## 3. Register
| Caller | Call | File |
|---|---|---|
| Projection | `this.register(args)` | Its own export file |
| Projection | `this.registerInto(path, args)` | The file you name |
| Snippet | `this.register({ ...args, destinationPath })` | The file you name |
`args` is `{ imports?, definitions?, custom? }`. There is no `reExports`.
- Swift imports a module, never a name: `imports: ['Foundation']`.
- The producer that writes a name of a module registers its import, in
its constructor. `Date` and `Data` need `Foundation`. `Codable`,
`Hashable` and `Sendable` need no import.
- The file renders its imports sorted, one on each line.
- With no `custom`, a file starts with
`// Generated by Skmtc. Do not edit.`.
## 4. Identifier kinds
| Kind | Factory | Renders |
|---|---|---|
| `struct` | `createStruct(name)` | `public struct Pet` + value |
| `enum` | `createEnum(name)` | `public enum PetStatus` + value |
| `class` | `createClass(name)` | `public final class PetsClient` + value |
| `protocol` | `createProtocol(name)` | `public protocol Transport` + value |
| `typealias` | `createTypealias(name)` | `public typealias Tags = ` + value |
| `func` | `createFunction(name)` | `public func listPets` + value |
- An identifier is `public` unless you make it with `exported: false`.
A declaration with no access level is for its own module only. A
generated SDK is a module of its own.
- A `public` struct needs an initializer in the source. The one that
Swift writes itself is for the module of the struct only.
- `toIdentifierType` gives the kind of a definition before its value
exists. An operation has one kind (`func`, or `struct` for an Index).
- The kind of a model depends on its schema: a struct, an enum or a type
alias. Do not read the schema a second time in `toIdentifierType`.
Give a fixed kind there. In the constructor of the projection, call
`this.declareAs(kind)` with the kind of the value that the router
built (section 11). `declareAs` is a method of the model base.
## 5. Head and value
The identifier renders the head of a declaration, and the value renders
all that follows. The value of a `struct` or an `enum` is a
`SwiftTypeBody`: what the type inherits from, and its members in braces.
The value of a `typealias` is the type.
**A comment is above its declaration**, where the value cannot write
it. The engine passes no description to a definition, so the value
gives it. A value that implements `SwiftDocumented` has a field named
`comment` that holds a `SwiftComment`. Its definition writes that
comment above the head.
```ts fragment
export class SwiftCodableProjection extends SwiftCodableBase implements SwiftDocumented {
comment: SwiftComment
value: GeneratedValue
constructor({ context, ref, settings }: ConstructorArgs) {
super({ context, ref, settings })
this.comment = new SwiftComment(schema.description)
…
}
}
```
The text of a `SwiftComment` is a string or a producer. Give it a
producer when the comment has parts (the summary, the route and the
parameters of a method). The comment reads the producer when the file
renders, so no constructor renders text.
**An attribute is above its declaration too**, between the comment and
the head. A value that implements `SwiftAttributed` has a field named
`attributes` that holds a `SwiftAttributes`. `SwiftDeprecated` is the
attribute `@available(*, deprecated)`. Give it a message, and the
compiler shows the message in its warning:
```ts fragment
this.attributes = new SwiftAttributes([
operation.deprecated === true
? new SwiftDeprecated('Deprecated in the API document.')
: undefined,
])
```
## 6. Optionals
A value that can be absent is an optional: `String?`.
`SwiftOptional({ type, optional })` writes the question mark.
- `Codable` reads a key that is absent and a key that is `null` as
`nil`. It writes no key for a `nil` value. So "not required" and
"nullable" are one type.
- Decide the question mark in one class (`SwiftCodableOptional` in
`gen-swift-codable`).
- A struct cannot hold itself: `var parent: Category?` in `Category`
does not compile. An array and a dictionary store their values
outside the struct, so `[Category]` compiles.
- A struct cannot store a reference inside a cycle in place
(`modelRef.suspended || modelRef.inCycle`). For that reference, write
a type that stores its value outside the struct, such as `Indirect`
in `gen-swift-codable/base-files/`.
## 7. Indentation
A producer renders its own lines from column 0. `SwiftBlock` and
`SwiftIndented` write the four spaces of each level, so blocks nest to
any depth. Fixed lines of a template have their own spaces.
No formatter runs. A project sets `settings.formatter` to its formatter,
such as `swift-format format --in-place`.
## 8. Producers
| Producer | Renders |
|---|---|
| `SwiftList.toArguments(items)`, `.toParameters`, `.toLines`, `.toParagraphs` | `a, b`, one item on each line with a comma, one item on each line, a blank line between items |
| `SwiftBlock(statements, { separator? })` | `{`, the statements one level deeper, `}`. `{}` for none |
| `SwiftIndented(content)` | The content one level deeper |
| `SwiftTypeBody({ inherits?, members })` | `: Codable, Sendable { … }`, with a blank line between members |
| `SwiftInheritance(types)` | `: String, Codable`, or nothing |
| `SwiftProperty({ name, type, description?, exported?, constant? })` | `public var id: String`, with its comment above. `let` for a `constant` |
| `SwiftComputedProperty({ name, type, value, description?, exported? })` | `public var pets: PetsService { PetsService(client: self) }` |
| `SwiftInitializer({ parameters, statements, exported? })` | `public init(…) { … }`, one parameter on each line |
| `SwiftParameter({ name, type, optional? })` | `id: String`, and `notes: String? = nil` for an `optional` one |
| `SwiftAssignment(name)` | `self.id = id` |
| `SwiftArrayType(items)` | `[Pet]` |
| `SwiftDictionaryType(value)` | `[String: Pet]` |
| `SwiftGenericType({ name, argument })` | `Indirect<Category>` |
| `SwiftExtension({ type, members })` | `extension APIClient { … }` |
| `SwiftStringLiteral(value)` | `"in_progress"`, with the escapes of Swift |
| `SwiftEnumCase({ name, rawValue?, payload? })` | `case shipped`, `case inProgress = "in_progress"`, `case cat(Cat)` |
| `SwiftStringCase({ name, value })` | A case of an enum of strings, or a key of `CodingKeys`: `case shipped` where the name is the string, and `case inProgress = "in_progress"` where it is not. The backticks of a keyword are not a part of the name: `` case `class` `` |
| `SwiftFunctionValue({ parameters, isAsync?, throws?, result?, statements })` | What follows the name of a function: `(petId: Int) async throws -> Pet { … }` |
| `SwiftCall({ callee, arguments })` | `APIRequest(method: "GET", path: "/pets")` |
| `SwiftArgument({ label?, value })` | `method: "GET"`, or the value only |
| `SwiftChain({ receiver, calls })` | A value, and each call on a line of its own with a dot before it |
| `SwiftMemberSet(members)` | The members that an Index gets, with a blank line between them |
| `SwiftOptional({ type, optional })` | `String?`, or `String` |
| `SwiftAccess({ exported? })` | `public `, or nothing |
| `SwiftComment(text)` | `/// text` on each line, or nothing |
| `SwiftAttributes(attributes)` | Each attribute on a line of its own above a declaration, or nothing |
| `SwiftDeprecated(message?)` | `@available(*, deprecated)`, or `@available(*, deprecated, message: "…")` |
An item that is `undefined` or `null` is absent. A producer builds its
parts in its constructor. `SwiftMemberSet` is the one producer that
reads its array when it renders: the members of an Index arrive after
the constructor. A `SwiftComment` reads its text when it renders.
Only a `toString()` method writes Swift code. A constructor stores
producers and facts: a name, a path, a flag. For a piece of syntax that
is not in this table, write a class with the syntax in its
`toString()`. If two generators would write it, add it to this package.
## 9. A member for each operation: the Index
Swift declares a method inside the braces of its type. A service with a
method for each operation is an Index.
`toSwiftOasOperationIndexBase` makes the struct. Each method is an
operation projection with `toIndex` and no `toExportPath`.
```ts fragment
const ServiceBase = toSwiftOasOperationIndexBase<EnrichmentSchema>({
id: denoJson.name,
toIdentifierName: ({ operation }) => toServiceName(operation),
toIdentifierType: () => ({ type: 'struct' }),
toExportPath: ({ operation }) => toServicePath(operation),
})
export class Service extends ServiceBase {
body: SwiftTypeBody
constructor(args: OasOperationIndexConstructorArgs<EnrichmentSchema>) {
super(args)
this.body = new SwiftTypeBody({
inherits: SERVICE_PROTOCOLS,
members: [
new SwiftProperty({ name: CLIENT_PROPERTY, type: CLIENT, exported: false, constant: true }),
new SwiftMemberSet(this.definitions),
],
})
}
}
```
- The methods arrive after the constructor of the Index. Give the
`definitions` array itself to a `SwiftMemberSet`. Do not copy it.
- The kind of a method is `func`. Its value is a `SwiftFunctionValue`.
- An Index holds each kind of Swift declaration except a protocol, which
Swift 5.9 refuses inside a type.
- The entry inserts the method only. The engine makes the Index for the
first method.
- A declaration can belong to the service and be outside its braces.
An example is an `extension` of the client with a property for the
service. Make it a part of the value of the Index, after the body: a
`SwiftExtension` with a `SwiftComputedProperty`. `gen-swift-urlsession/src/Service.ts`
shows this.
## 10. Names and literals
- `new SwiftName(text).toType()` for a struct, an enum and a type
alias: `order_item` gives `OrderItem`. `.toMember()` for a property, a
parameter and a case: `unit-price` gives `unitPrice`. Each form is a
valid Swift name for any text. A text with no letter and no digit
gives `Value` and `value`.
- Each word is a capital and lower case: `APIKey` gives `ApiKey`, and
`IN_PROGRESS` gives `inProgress`.
- The small letters after a digit are a part of its word: `2nd line`
gives `_2ndLine`, and `api2_url` gives `api2Url`.
- `toMember()` writes a keyword in backticks (`` `class` ``), which
Swift reads as a name. Write the result as it is, in each place:
`` self.`class` = `class` ``.
- Two names get an underscore at the end: `self` and `hashValue`
(`swiftReservedMembers`). A parameter named `self` hides the instance
in an initializer. `toType()` does the same for `Type`, `Protocol`,
`Any` and `Self` (`swiftReservedTypes`).
- `new SwiftNameScope(reserved).claim(name)` makes the names of one
list unique: the properties of a struct, the cases of an enum. Two
keys can give one Swift name (`user-id` and `user_id`).
- `new SwiftStringLiteral(value)` is a string of the document as a Swift
string. Use it for each key, each enum value and each path. It writes
a control character as `\u{1f}`, and keeps a `\(` of the document from
an interpolation.
## 11. A declaration and a type position differ
An object with properties has two forms. Where Swift declares it, it is
the body of a struct. Where a property or a parameter has it as a type,
it is only a name. A string with an `enum` is the same, with an enum.
The router contract has no argument for the position, and a generator
has one router. A **type scope** solves this:
1. The router takes a `scope` beside the arguments of `SchemaToValueFn`.
2. The producer of a schema that needs a type calls
`scope.declare({ createIdentifier, value })`.
3. That producer renders the name that `declare` returns.
| Scope | Who makes it | What `declare` does |
|---|---|---|
| `SwiftOwnType` | The projection of a model, for the schema of the model | Keeps the value and the kind. The model is that type |
| `SwiftNestedTypes` | A struct or an enum, for its parts | Adds a nested type to the parent: `Order.ShipTo` |
| `SwiftFileTypes` | A declaration with no braces: a function, a type alias | Registers a type in the file, with the name of the declaration first: `GetApiPetsResponse` |
```ts fragment
// The projection of a model.
const own = new SwiftOwnType({ context, destinationPath, toTypeName, name: settings.identifier.name })
const type = toSwiftCodableValue({ schema, destinationPath, required: true, context, scope: own })
this.value = own.value ?? type
this.declareAs(own.kind)
```
- A producer that holds a part of a schema gives the part a child of
its scope. The items of an array get `scope.toChild('Item')`, and a
property gets `scope.toChild(name)`. The name of a type is its parts:
`LinesItem`.
- A struct makes one `SwiftNestedTypes`, and gives a child of it to
each property. It then puts `nestedTypes.definitions` among the
members of its `SwiftTypeBody`.
- A nested type cannot meet a type of the module. Thus two schemas of
one document do not give one name.
- Inside its parent, a nested type hides a type of the module that has
the same name. Give the scope the name rule of the generator
(`toTypeName`). Then no nested type has the name `Date` or `Data`.
- An operation generator does not make a scope. It makes the name of
the type in its own `base.ts`. It gives the name and the schema to a
producer of the model generator: `SwiftCodableType` in
`gen-swift-codable`. The model generator declares the type.
- `toInlineTypeName(stackTrail, words)` names an inline schema from its
place in the document. `words` are the parts that the generator
chooses (`Item`, `Value`, `Body`, `Response`), from its `base.ts`. Use
the function only where no declaration gives a name: the
`schemaToValueFn` static that `insertNormalizedModel` calls.
## 12. Pitfalls
| Symptom | Fix |
|---|---|
| `cannot find type 'Date' in scope` | The producer that writes `Date` did not register `'Foundation'` |
| `value type 'Category' cannot have a stored property that recursively contains it` | A struct holds itself in place. Hold a reference inside a cycle through a type that stores its value outside the struct |
| `invalid redeclaration of 'Pet'` | Two files of the module declare one name. Give one of them another name in `base.ts` |
| `'Data' is ambiguous for type lookup`, or a property of the wrong type | A model has the name of a type of Swift. Give it another name in `base.ts`: `swiftStandardTypes` has the names |
| `type 'Order' does not conform to protocol 'Decodable'` | A property has a type that is not `Codable`, or a model has the name `CodingKeys` |
| `initializer is inaccessible due to 'internal' protection level`, in the project that uses the models | The struct has no initializer in the source. Add a `SwiftInitializer` |
| `value of type 'String?' has no member 'id'`, in an initializer | A parameter has the name `self`. Make each name with `SwiftName.toMember()` |
| `raw value for enum case is not unique` | Two cases have one raw value. Keep each value of the document once |
| A property has the type of a nested type, not of the model of the same name | A nested type hides a type of the module inside its parent (section 11). Change the name of the property's type in a clone, or move the inline schema to `components.schemas` |
| A declaration has no comment | Its value has no `comment` field that holds a `SwiftComment` (section 5) |
| A model has the head `typealias` and its value is a struct body | The projection did not call `declareAs` with the kind of its value (section 4) |
| `Cannot register Swift content into '…': another language made the file` | Two generators write one path. Give the Swift file its own path in `toExportPath` |
## 13. The reference SDK
The style reference for generated Swift is an SDK that people wrote:
[MacPaw/OpenAI](https://github.com/MacPaw/OpenAI) at commit
`80e60109ac16f35fa7277fd1352bfc60cfa9a84a` (2026-11-24, MIT). No Swift
SDK for an HTTP JSON API has more stars. Its public shape is `Codable`,
`Sendable` structs and `async throws` methods on `URLSession`. The
second reference is the Petstore output of
apple/swift-openapi-generator. Use it for model edge cases: recursion,
`allOf`, and where to write `any`. Compare the output of a generator
with these conventions before you change what it writes.
### Conventions
1. One SwiftPM package, one library target, sources under
`Sources/<Module>/` (`Package.swift:6-28`).
2. One file for each top-level model, with the name of the type
(`Public/Models/EmbeddingsQuery.swift:10`).
3. A model is a `public struct` that conforms to `Codable` and
`Sendable`, with `Hashable` added. Its fields are in lowerCamelCase
(`Public/Models/EmbeddingsResult.swift:10`).
4. A `CodingKeys` enum maps the wire names, not a key strategy. It
lists every field. It gives a raw value only when the wire name
differs: `enum CodingKeys: String, CodingKey`
(`Public/Schemas/Edited/OpenAIFile.swift:108-118`).
5. Each model has an explicit `public init` with one parameter on each
line. A required field has no default, and an optional field has the
default `nil` (`Public/Models/EmbeddingsQuery.swift:27-39`). Swift's
own memberwise initializer is internal.
6. Optional and nullable both become `T?`: not required, nullable, and
required and nullable (`Public/Models/ModerationsResult.swift:40-41`).
7. An inline object or enum of a field is a type inside its parent. It
has the name of the field in UpperCamelCase
(`Public/Models/EmbeddingsQuery.swift:13`, `:41`, `:78`).
8. A string enum is `enum X: String, Codable, Sendable` with
lowerCamelCase cases. A case has a raw value only when the wire
value is not the case name
(`Public/Models/EmbeddingsQuery.swift:78-81`).
9. A union (`oneOf`) is an enum with one associated value for each
member and a single-value container. It has both `init(from:)` and
`encode(to:)` (`Public/Models/ChatQuery.swift:499-522`). A union with
a discriminator decodes the tag first
(`Public/Models/AssistantsTool.swift:37-52`).
10. Arrays are `[T]` and maps are `[String: T]`, with no wrapper types.
11. Doc comments are `///`, directly above the field or the method, with
the description as plain text. A method's parameters use
`- Parameter name:` (`Public/Protocols/FilesEndpointAsync.swift:16-18`).
A deprecated member gets `@available(*, deprecated, message:)`
(`Public/Models/ChatQuery.swift:47`).
12. The client holds a `Configuration` and takes a `URLSession`
(`OpenAI.swift:13-61`). The SDK marks it `@unchecked Sendable`. A
generator writes `Sendable` with no `@unchecked`, as
`FilesEndpoint.swift:8` does.
13. A sub-client has the methods of one resource: `openAI.files` is a
`FilesEndpoint` (`OpenAI.swift:70`, `FilesEndpoint.swift:8`).
14. A method is `public func name(...) async throws -> Result`. Its body
is one expression: it builds a request value and gives it to the
shared function that sends. The result is the decoded model, not a
response wrapper (`FilesEndpoint+Async.swift:13-15`).
15. Each path parameter is an argument with a label
(`Public/Protocols/OpenAIAsync.swift:28-32`).
16. The request body is the `Codable` struct, encoded with a
`JSONEncoder` (`Private/JSONRequest.swift:13-24`).
17. One shared function sends and decodes: `session.data(for:)`, a check
of the status, then `JSONDecoder().decode`
(`Private/Client/AsyncClient.swift:34-42`).
18. A status of 400 or above throws. The SDK first reads the body as a
typed `APIErrorResponse`. If that read fails, it throws an enum case
with the status code and the `HTTPURLResponse`. The case does not
hold the body (`Private/URLResponseHandler.swift:64-73`,
`APIError.swift:14-23`).
19. People write the runtime, and it is the same for every API. It is
the request value, the URL builder, the send function, the
configuration and the error. Models, paths and methods are for each
API.
### Where the generators differ from it, on purpose
- **Async only.** The SDK also has callback and Combine forms. The
generated code has the `async throws` form only, and needs iOS 15 or
macOS 12.
- **Each header and query parameter is an argument with a label.** The SDK has
one `query:` struct and no header parameter for a method. An optional
one has the default `nil`.
- **Path values are percent-encoded**, also `/`. The SDK does not
encode them.
- **`format: date-time` is a `Date`.** The runtime reads and writes it
as RFC 3339. `format: date` stays a `String`. `format: byte` is
`Data`.
- **Free-form JSON is a small `JSONValue` enum** in the runtime, with a
`null` case. The SDK uses a type of Apple's OpenAPI runtime.
- **A struct that holds itself** stores the value through a box of the
runtime (`Indirect`). An array or a dictionary of itself needs none.
- **One error type** in the runtime, with the status, the body and the
response.
- **The client is a struct** with `var` properties and an
`authorized(with:)` copy, not a `final class`.
- **A response that is not an `HTTPURLResponse` throws**, and so does
any status outside 200 to 299. The SDK lets the first through, and
checks only for 400 or above.
- **A method with no response schema returns nothing** and reads no
body.
- **A base URL** in place of scheme, host, port and base path.
- **`var` fields**, as Apple's generator writes. The SDK uses `let`.
- **Swift 6.** Models are `Sendable` structs and enums, with no
`@unchecked`. An existential type has `any`: `any Encodable`.
- **Linux.** Each file that uses `URLSession` has
`#if canImport(FoundationNetworking)`.
- **Names that Swift does not allow.** A keyword takes backticks, and a
nested type never has the name `Type` or `Protocol`.
- **A required property that is nullable has no default.** Its
parameter of the initializer is `needed: String?`. The reference
gives every optional field the default `nil` (convention 5). A caller
thus always gives a value for a property that the document requires.
A struct with such a property has its own `encode(to:)`, which
writes `null` for a `nil` value of that property. The encoder that
Swift writes leaves out the key.
### Not for a default generator
- Callback and Combine forms, streams and middleware.
- Multipart upload, and relaxed reads for other vendors.
- Open enums that accept unknown values.
- Convenience overloads and pagers.
- SSL pins and JSON Schema builders.
- Retries, rate limits and telemetry.
A closed `String` enum is the default. Know its cost: the decode of a whole response fails when the
server adds a value. The open form is a `RawRepresentable` struct with
static constants, and belongs in a clone.
### Not yet as the reference has it
- Convention 9: `gen-swift-codable` writes an enum only for a union
that its discriminator decides (`isDiscriminable` of the parser). It
writes `JSONValue` for each other `oneOf` and `anyOf`. The caller
reads that value into the member that it expects.
- Convention 9: the enum of a union tries each member in order. It
does not decode the tag first. Core does not give the discriminator
strings of each member to a generator.
- Convention 11: `gen-swift-urlsession` writes
`@available(*, deprecated, message:)` for a deprecated operation. A
deprecated property gets a line in its comment, and no attribute.
With the attribute, the initializer that sets the property gives a
warning. A deprecated parameter gets nothing.