Skip to content

Commit cfbbbd3

Browse files
committed
✏️fix: fix typos and spell mistakes
1 parent 3fb26cd commit cfbbbd3

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

hacks/README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,39 @@
33
## Code generator limitations
44

55
### oneOf
6-
Some openapi-generator's codegen (Rust) don't like oneOf types with identical type.
7-
It get confused and the produced code don't compile. Typescript Codegen
8-
don't support OneOf at all. the only use of oneOf in osc-api is the
9-
following pattern
6+
Some openapi-generator codegens (Rust) don't handle oneOf types with identical types well.
7+
They get confused and the produced code doesn't compile. Typescript codegen
8+
doesn't support oneOf at all. The only use of oneOf in osc-api is the
9+
following pattern:
1010

1111
```yaml
1212
oneOf:
1313
- type: string
1414
format: date
1515
- type: string
16-
fromat: date-string
16+
format: date-string
1717
```
18-
[Rust OneOf](https://github.com/OpenAPITools/openapi-generator/issues/18527)
18+
[Rust OneOf](https://github.com/OpenAPITools/openapi-generator/issues/18527)
1919
[Rust date-time](https://github.com/OpenAPITools/openapi-generator/issues/19319)
2020
2121
### date-time
22-
Some openapi-generator's codegen (Go) have herattic implementation of
23-
date-time and date. Go Codegen transpile date-time to time.Time
24-
(both RFC3339, so it's ok), but don't implemente date
25-
(which fallback into string). Rust Codegen transpile everything to string
22+
Some openapi-generator codegens (Go) have erratic implementations of
23+
date-time and date. Go codegen transpiles date-time to time.Time
24+
(both RFC3339, so that's ok), but doesn't implement date
25+
(which falls back to string). Rust codegen transpiles everything to string.
2626
27-
With actual patches, everything is baslicly passed at string.
28-
suboptimal but it's part of the prototype
27+
With current patches, everything is basically passed as string.
28+
It's suboptimal, but it's part of the prototype.
2929
30-
### AWS v4 Siguature
31-
Typescript-fetch codegen does not support AWS v4 Siguature. PR prending
30+
### AWS v4 Signature
31+
Typescript-fetch codegen does not support AWS v4 Signature. PR pending
3232
for typescript-axios.
3333
3434
## Patch
35-
`patch.rb` is a collections of workarounds for code generators limitations.
35+
`patch.rb` is a collection of workarounds for code generator limitations.
3636

3737
- nodatetime: remove date-time format from strings
3838
- nodate: remove date format from strings
39-
- nooneof: substitube oneOf for the first type defined
39+
- nooneof: substitute oneOf for the first type defined
4040
- noproperties-array: inflate array's items definition
4141
- patch: apply strategic merge patch in post-process. Should be last resort

hacks/patch.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
api = Psych.load_file options[:input], permitted_classes: [Time]
1717

1818
def patch_no_oneof(arg_info)
19-
# Remove all oneOf by substituing for the first element in the array
19+
# Remove all oneOf by substituting for the first element in the array
2020
if arg_info.key?("oneOf") then
2121
arg_info["oneOf"][0].each do |key, val|
2222
arg_info[key] = val
@@ -52,7 +52,7 @@ def patch_no_date(arg_info)
5252
return arg_info
5353
end
5454

55-
def patch_no_poperties_array(prop_info)
55+
def patch_no_properties_array(prop_info)
5656
if prop_info["type"] == "array" && prop_info.key?("items")
5757
items = prop_info["items"]
5858
if items.key?("$ref")
@@ -71,7 +71,7 @@ def patch_no_poperties_array(prop_info)
7171
end
7272

7373
if options.key?(:nopropertiesarray) then
74-
# Index properties for later use by patch_no_poperties_array
74+
# Index properties for later use by patch_no_properties_array
7575
$no_properties = []
7676
api["components"]["schemas"].each do |call_name, call|
7777
unless call.key?("properties")
@@ -96,14 +96,14 @@ def patch_no_poperties_array(prop_info)
9696
end
9797

9898
if options.key?(:nopropertiesarray) then
99-
arg_info = patch_no_poperties_array(arg_info)
99+
arg_info = patch_no_properties_array(arg_info)
100100
end
101101
end
102102
end
103103
end
104104

105105
if options.key?(:patch) then
106-
# As a last ressource, patch openapi with strategic merge patch
106+
# As a last resource, patch openapi with strategic merge patch
107107
patch = Psych.load_file options[:patch], permitted_classes: [Time]
108108

109109
def strtegic_merge(base, p)

0 commit comments

Comments
 (0)