Skip to content

Commit

Permalink
Merge pull request #59 from redhat-developer/go-sdk-fixing
Browse files Browse the repository at this point in the history
Go sdk fixing
  • Loading branch information
jackdelahunt authored Jan 25, 2023
2 parents b570dd8 + c6e2736 commit 4a05b03
Show file tree
Hide file tree
Showing 662 changed files with 26,778 additions and 33,948 deletions.
13 changes: 4 additions & 9 deletions .openapi-generator-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,19 @@
**/.openapi-generator-ignore
**/.openapi-generator
**/git_push.sh
**/.travis.yml
**/build.gradle
**/build.sbt
**/gradle.properties
**/gradlew
**/gradlew.bat
**/settings.gradle
**/git_push.sh
**/gradlew.bat
**/src/test/**
**/.gradle/*
**/.project
**/.settings/*
**/build.gradle
**/build.sbt
**/gradle.properties
**/gradle/**/*
**/gradlew
**/gradlew.bat
**/settings.gradle
**/.classpath
**/.classpath
**/go.mod
**/go.sum
**/api
16 changes: 13 additions & 3 deletions .openapi/registry-instance.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"openapi": "3.0.2",
"info": {
"title": "Service Registry API",
"title": "Apicurio Registry API [v2]",
"version": "2.2.5.Final",
"description": "Service Registry Instance API \nNOTE: This API cannot be called directly from the portal.",
"description": "Apicurio Registry is a datastore for standard event schemas and API designs. Apicurio Registry enables developers to manage and share the structure of their data using a REST interface. For example, client applications can dynamically push or pull the latest updates to or from the registry without needing to redeploy. Apicurio Registry also enables developers to create rules that govern how registry content can evolve over time. For example, this includes rules for content validation and version compatibility.\n\nThe Apicurio Registry REST API enables client applications to manage the artifacts in the registry. This API provides create, read, update, and delete operations for schema and API artifacts, rules, versions, and metadata. \n\nThe supported artifact types include:\n- Apache Avro schema\n- AsyncAPI specification\n- Google protocol buffers\n- GraphQL schema\n- JSON Schema\n- Kafka Connect schema\n- OpenAPI specification\n- Web Services Description Language\n- XML Schema Definition\n\n\n**Important**: The Apicurio Registry REST API is available from `https://MY-REGISTRY-URL/apis/registry/v2` by default. Therefore you must prefix all API operation paths with `../apis/registry/v2` in this case. For example: `../apis/registry/v2/ids/globalIds/{globalId}`.\n",
"contact": {
"name": "Apicurio",
"url": "https://github.com/apicurio/apicurio-registry",
Expand Down Expand Up @@ -679,6 +679,13 @@
"Admin"
],
"parameters": [
{
"in": "header",
"name": "Accept",
"schema": {
"type": "string"
}
},
{
"name": "forBrowser",
"description": "Indicates if the operation is done for a browser. If true, the response will be a JSON payload with a property called `href`. This `href` will be a single-use, naked download link suitable for use by a web browser to download the content.",
Expand Down Expand Up @@ -2022,7 +2029,10 @@
"description": "The content of the artifact being created. This is often, but not always, JSON data\nrepresenting one of the supported artifact types:\n\n* Avro (`AVRO`)\n* Protobuf (`PROTOBUF`)\n* JSON Schema (`JSON`)\n* Kafka Connect (`KCONNECT`)\n* OpenAPI (`OPENAPI`)\n* AsyncAPI (`ASYNCAPI`)\n* GraphQL (`GRAPHQL`)\n* Web Services Description Language (`WSDL`)\n* XML Schema (`XSD`)\n",
"content": {
"*/*": {
"schema": {},
"schema": {
"format": "binary",
"type": "string"
},
"examples": {
"OpenAPI Example": {
"value": {
Expand Down
4 changes: 2 additions & 2 deletions app-services-sdk-go/accountmgmt/apiv1/api_client.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package accountmgmt

import (
"github.com/redhat-developer/app-services-sdk-go/core"
"github.com/jackdelahunt/app-services-sdk-core/app-services-sdk-go/core"

apiv1 "github.com/redhat-developer/app-services-sdk-go/accountmgmt/apiv1/client"
apiv1 "github.com/jackdelahunt/app-services-sdk-core/app-services-sdk-go/accountmgmt/apiv1/client"
)

// APIConfig defines the available configuration options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ docs/QuotaRulesAllOf.md
docs/QuotaRulesList.md
docs/QuotaRulesListAllOf.md
docs/Registry.md
docs/RegistryAddressValue.md
docs/RegistryAllOf.md
docs/RegistryCreateRequest.md
docs/RegistryCredential.md
Expand Down Expand Up @@ -320,7 +319,6 @@ model_quota_rules_all_of.go
model_quota_rules_list.go
model_quota_rules_list_all_of.go
model_registry.go
model_registry_address_value.go
model_registry_all_of.go
model_registry_create_request.go
model_registry_credential.go
Expand Down Expand Up @@ -403,6 +401,4 @@ model_terms_review_response.go
model_token_authorization_request.go
model_token_authorization_response.go
response.go
test/api_app_services_test.go
test/api_default_test.go
utils.go
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.2.1
5.2.0
17 changes: 8 additions & 9 deletions app-services-sdk-go/accountmgmt/apiv1/client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ go get golang.org/x/net/context
Put the package under your project folder and add the following in import:

```golang
import accountmgmtclient "github.com/GIT_USER_ID/GIT_REPO_ID"
import sw "./accountmgmtclient"
```

To use a proxy, set the environment variable `HTTP_PROXY`:
Expand All @@ -40,15 +40,15 @@ Default configuration comes with `Servers` field that contains server objects as
For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`.

```golang
ctx := context.WithValue(context.Background(), accountmgmtclient.ContextServerIndex, 1)
ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1)
```

### Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`.

```golang
ctx := context.WithValue(context.Background(), accountmgmtclient.ContextServerVariables, map[string]string{
ctx := context.WithValue(context.Background(), sw.ContextServerVariables, map[string]string{
"basePath": "v2",
})
```
Expand All @@ -58,14 +58,14 @@ Note, enum values are always validated and all unused variables are silently ign
### URLs Configuration per Operation

Each operation can use different server URL defined using `OperationServers` map in the `Configuration`.
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
An operation is uniquely identifield by `"{classname}Service.{nickname}"` string.
Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps.

```golang
ctx := context.WithValue(context.Background(), accountmgmtclient.ContextOperationServerIndices, map[string]int{
```
ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{
"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), accountmgmtclient.ContextOperationServerVariables, map[string]map[string]string{
ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{
"{classname}Service.{nickname}": {
"port": "8443",
},
Expand Down Expand Up @@ -328,7 +328,6 @@ Class | Method | HTTP request | Description
- [QuotaRulesList](docs/QuotaRulesList.md)
- [QuotaRulesListAllOf](docs/QuotaRulesListAllOf.md)
- [Registry](docs/Registry.md)
- [RegistryAddressValue](docs/RegistryAddressValue.md)
- [RegistryAllOf](docs/RegistryAllOf.md)
- [RegistryCreateRequest](docs/RegistryCreateRequest.md)
- [RegistryCredential](docs/RegistryCredential.md)
Expand Down Expand Up @@ -432,7 +431,7 @@ Note, each API key must be added to a map of `map[string]APIKey` where the key i
Example

```golang
auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARER_TOKEN_STRING")
auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARERTOKENSTRING")
r, err := client.Service.Operation(auth, args)
```

Expand Down
Loading

0 comments on commit 4a05b03

Please sign in to comment.