Skip to content

Commit 4296155

Browse files
Merge pull request #5 from speakeasy-api/improve-presence
2 parents b952c7d + 28ed22a commit 4296155

File tree

7 files changed

+120
-12
lines changed

7 files changed

+120
-12
lines changed

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @speakeasy-api/speakeasy-maintainers

.github/assets/speakeasy.png

72.5 KB
Loading

.github/workflows/test.yaml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test-and-build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Set up Go
17+
uses: actions/setup-go@v4
18+
with:
19+
go-version: "1.23"
20+
21+
- name: Install dependencies
22+
run: go mod download
23+
24+
- name: Run golangci-lint
25+
uses: golangci/golangci-lint-action@v3
26+
with:
27+
version: latest
28+
29+
- name: Run tests
30+
run: go test -v ./...
31+
32+
- name: Build
33+
run: go build -v ./...

README.md

+50-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,59 @@
1-
# github.com/speakeasy-api/openapi
1+
[![https://www.speakeasy.com](.github/assets/speakeasy.png?raw=true)](https://www.speakeasy.com)
2+
3+
# [github.com/speakeasy-api/openapi](https://github.com/speakeasy-api/openapi)
4+
5+
[![Reference](https://godoc.org/github.com/speakeasy-api/openapi?status.svg)](http://godoc.org/github.com/speakeasy-api/openapi)
6+
[![Test](https://github.com/speakeasy-api/openapi/actions/workflows/test.yaml/badge.svg)](https://github.com/speakeasy-api/openapi/actions/workflows/test.yaml)
7+
[![GoReportCard](https://goreportcard.com/badge/github.com/speakeasy-api/openapi)](https://goreportcard.com/report/github.com/speakeasy-api/openapi)
8+
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
29

310
The Speakeasy OpenAPI module provides a set of packages and tools for working with OpenAPI Specification documents.
411

12+
Used directly in Speakeasy's products it powers our [SDK Generator](https://www.speakeasy.com/docs/create-client-sdks) and [Contract Testing](https://www.speakeasy.com/docs/testing) tools.
13+
514
Documentation for the packages can be found in the [GoDoc documentation.](https://pkg.go.dev/github.com/speakeasy-api/openapi)
615

716
## Main Packages
817

918
### [arazzo](./arazzo)
1019

11-
The `arazzo` package provides an API for working with Arazzo documents including reading, creating, mutating, walking and validating them.
20+
The `arazzo` package provides an API for working with Arazzo documents including reading, creating, mutating, walking and validating them.
21+
22+
## Sub Packages
23+
24+
This repository also contains a number of sub packages that are used by the main packages to provide the required functionality. The below packages may be moved into their own repository in the future, depending on future needs.
25+
26+
### [json](./json)
27+
28+
The `json` package provides utilities for converting between JSON and YAML.
29+
30+
### [jsonpointer](./jsonpointer)
31+
32+
The `jsonpointer` package provides an API for working with [RFC 6901](https://datatracker.ietf.org/doc/html/rfc6901) compliant JSON Pointers. Providing functionality for validating JSON Pointers, and extracting the target of a JSON Pointer for various Go types and structures.
33+
34+
### [jsonschema](./jsonschema)
35+
36+
The `jsonschema` package provides various models for working with the different JSON Schema dialects.
37+
38+
### [sequencedmap](./sequencedmap)
39+
40+
The `sequencedmap` package provides a map implementation that maintains the order of keys as they are added.
41+
42+
## Contributing
43+
44+
This repository is maintained by Speakeasy, but we welcome and encourage contributions from the community to help improve its capabilities and stability.
45+
46+
### How to Contribute
47+
48+
1. **Open Issues**: Found a bug or have a feature suggestion? Open an issue to describe what you'd like to see changed.
49+
50+
2. **Pull Requests**: We welcome pull requests! If you'd like to contribute code:
51+
- Fork the repository
52+
- Create a new branch for your feature/fix
53+
- Submit a PR with a clear description of the changes and any related issues
54+
55+
3. **Feedback**: Share your experience using the packages or suggest improvements.
56+
57+
All contributions, whether they're bug reports, feature requests, or code changes, help make this project better for everyone.
58+
59+
Please ensure your contributions adhere to our coding standards and include appropriate tests where applicable.

arazzo/README.md

+27-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
# github.com/speakeasy-api/openapi/arazzo
1+
[![https://www.speakeasy.com](../.github/assets/speakeasy.png?raw=true)](https://www.speakeasy.com)
2+
3+
# [github.com/speakeasy-api/openapi/arazzo](https://github.com/speakeasy-api/openapi/arazzo)
4+
5+
[![Reference](https://godoc.org/github.com/speakeasy-api/openapi/arazzo?status.svg)](http://godoc.org/github.com/speakeasy-api/openapi/arazzo)
6+
[![Test](https://github.com/speakeasy-api/openapi/actions/workflows/test.yaml/badge.svg)](https://github.com/speakeasy-api/openapi/actions/workflows/test.yaml)
7+
[![GoReportCard](https://goreportcard.com/badge/github.com/speakeasy-api/openapi)](https://goreportcard.com/report/github.com/speakeasy-api/openapi)
8+
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
29

310
The Arazzo package provides an API for working with Arazzo documents including reading, creating, mutating, walking and validating them.
411

@@ -199,3 +206,22 @@ func main() {
199206
}
200207
}
201208
```
209+
210+
## Contributing
211+
212+
This repository is maintained by Speakeasy, but we welcome and encourage contributions from the community to help improve its capabilities and stability.
213+
214+
### How to Contribute
215+
216+
1. **Open Issues**: Found a bug or have a feature suggestion? Open an issue to describe what you'd like to see changed.
217+
218+
2. **Pull Requests**: We welcome pull requests! If you'd like to contribute code:
219+
- Fork the repository
220+
- Create a new branch for your feature/fix
221+
- Submit a PR with a clear description of the changes and any related issues
222+
223+
3. **Feedback**: Share your experience using the packages or suggest improvements.
224+
225+
All contributions, whether they're bug reports, feature requests, or code changes, help make this project better for everyone.
226+
227+
Please ensure your contributions adhere to our coding standards and include appropriate tests where applicable.

arazzo/expression/expression.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ func getType(expression string) ([]string, ExpressionType) {
229229
return expressionParts, typ
230230
}
231231

232-
// TODO the spec is currently ambiguous on how to handle any additional dot seperated parts after the name so just treat as a name for now
232+
// TODO the spec is currently ambiguous on how to handle any additional dot separated parts after the name so just treat as a name for now
233233
// TODO there is probably something required to handle dots within a key name
234234
func validateName(expression, name, referenceType string) error {
235235
parts := strings.Split(name, ".")

errors/errors.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"strings"
88
)
99

10-
// ErrSeperator is used to seperate the message from the cause in the error message
11-
const ErrSeperator = " -- "
10+
// ErrSeparator is used to separate the message from the cause in the error message
11+
const ErrSeparator = " -- "
1212

1313
// Error provides a string based error type allowing the definition of const errors in packages
1414
type Error string
@@ -17,12 +17,12 @@ func (s Error) Error() string {
1717
return string(s)
1818
}
1919

20-
// Is checks if targer error is equivelant to Error
20+
// Is checks if target error is equivalent to Error
2121
func (s Error) Is(target error) bool {
22-
return s.Error() == target.Error() || strings.HasPrefix(target.Error(), s.Error()+ErrSeperator)
22+
return s.Error() == target.Error() || strings.HasPrefix(target.Error(), s.Error()+ErrSeparator)
2323
}
2424

25-
// As will set target errors value to equal Error if they are equivelant
25+
// As will set target errors value to equal Error if they are equivalent
2626
func (s Error) As(target interface{}) bool {
2727
v := reflect.ValueOf(target).Elem()
2828
if v.Type().Name() == "Error" && v.CanSet() {
@@ -44,7 +44,7 @@ type wrappedError struct {
4444

4545
func (w wrappedError) Error() string {
4646
if w.cause != nil {
47-
return fmt.Sprintf("%s%s%v", w.msg, ErrSeperator, w.cause)
47+
return fmt.Sprintf("%s%s%v", w.msg, ErrSeparator, w.cause)
4848
}
4949
return w.msg
5050
}
@@ -63,12 +63,12 @@ func (w wrappedError) Unwrap() error {
6363

6464
// The below are just wrappers as we are stealing the namespace of the errors package
6565

66-
// Is checks if err is equivelant to target
66+
// Is checks if err is equivalent to target
6767
func Is(err error, target error) bool {
6868
return errors.Is(err, target)
6969
}
7070

71-
// As will set target errors value to equal Error if they are equivelant
71+
// As will set target errors value to equal Error if they are equivalent
7272
func As(err error, target any) bool {
7373
return errors.As(err, target)
7474
}

0 commit comments

Comments
 (0)