Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
add workaround for #27
Browse files Browse the repository at this point in the history
  • Loading branch information
minchao committed Aug 27, 2020
1 parent c28e0d8 commit 8123e3a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ func main() {
{
Filename: "oas.rail.v2.json",
URL: "https://ptx.transportdata.tw/MOTC/v2/Rail/api-docs/oas",
Pipeline: []Step{
fixNotDefinedProperty,
},
},
{
Filename: "oas.rail.v3.json",
Expand Down Expand Up @@ -101,3 +104,12 @@ func fixProperty(data []byte) []byte {
},
"Ports": {`), -1)
}

// see https://github.com/minchao/go-ptx/issues/27
func fixNotDefinedProperty(data []byte) []byte {
return bytes.Replace(data,
[]byte(`"EndingStationName","StopStations","SrcUpdateTime","UpdateTime"`),
[]byte(`"EndingStationName","StopStations"`),
1,
)
}

0 comments on commit 8123e3a

Please sign in to comment.