@@ -108,27 +108,26 @@ extension GeoJSON.GeometryObject: Codable {
108108
109109extension GeoJSON . Feature {
110110
111- /// Create a feature with the provided `Encodable` as the properties
111+ /// Create a feature with the provided `Encodable` model as the properties
112112 /// - Parameters:
113113 /// - geometry: Geometry
114114 /// - properties: Known structure to use for the properties
115115 /// - id: GeoJSON-compatible ID, i.e., an Integer or a String
116116 /// - configure: Optional handler to configure how to encode the `Encodable`
117- public init < P: Encodable > ( geometry: GeoJSON . GeometryObject , properties : P , id: AnyHashable ? = nil , configure: ( inout JSONEncoder ) -> Void = { _ in } ) throws {
117+ public init < P: Encodable > ( geometry: GeoJSON . GeometryObject , model : P , id: AnyHashable ? = nil , configure: ( inout JSONEncoder ) -> Void = { _ in } ) throws {
118118 var encoder = JSONEncoder ( )
119119 configure ( & encoder)
120- let data = try encoder. encode ( properties )
120+ let data = try encoder. encode ( model )
121121 let asDict = try JSONSerialization . jsonObject ( with: data) as? [ String : AnyHashable ]
122122 self . init ( geometry: geometry, properties: asDict, id: id)
123123 }
124124
125-
126- /// Parses the properties as the provided `Decodable`
125+ /// Parses the properties as the provided `Decodable` model
127126 /// - Parameters:
128127 /// - type: Known structure to decode the feature's properties again
129128 /// - configure: Optional handler to configure how to decode the `Decodable`
130129 /// - Returns: Properties decoded as the provided `Decodable`
131- public func properties < P: Decodable > ( as type: P . Type , configure: ( inout JSONDecoder ) -> Void = { _ in } ) throws -> P {
130+ public func model < P: Decodable > ( as type: P . Type , configure: ( inout JSONDecoder ) -> Void = { _ in } ) throws -> P {
132131 let asData = try JSONSerialization . data ( withJSONObject: properties ?? [ : ] )
133132 var decoder = JSONDecoder ( )
134133 configure ( & decoder)
0 commit comments