Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To schema prototype #3

Merged
merged 12 commits into from May 3, 2023
Merged

To schema prototype #3

merged 12 commits into from May 3, 2023

Conversation

podhmo
Copy link
Owner

@podhmo podhmo commented May 2, 2023

No description provided.

@podhmo podhmo marked this pull request as ready for review May 3, 2023 15:15
@podhmo
Copy link
Owner Author

podhmo commented May 3, 2023

generated json by _examples/main.go https://github.com/podhmo/gos/pull/3/files#diff-ca5a130bae10a327e47aa31ce09f07ff45319253dfeab828204b4ed3da2691b3

{
  "components": {
    "schemas": {
      "Name": {
        "type": "string",
        "minlength": 1
      },
      "Person": {
        "type": "object",
        "description": "person object",
        "properties": {
          "name": {
            "type": "string",
            "description": "name of person"
          },
          "age": {
            "type": "integer",
            "format": "int32"
          },
          "nickname": {
            "$ref": "#/components/schemas/Name"
          },
          "father": {
            "$ref": "#/components/schemas/Person"
          },
          "friends": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Person"
            }
          }
        },
        "required": [
          "name",
          "age"
        ],
        "additionalProperties": false
      },
      "TestScore": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "tests": {
            "type": "object",
            "patternProperties": {
              "\\-score$": {
                "type": "integer",
                "description": "score (0~100)"
              },
              "\\-grade$": {
                "type": "string",
                "description": "grade (A,B,C,D,E,F)"
              }
            }
          }
        },
        "required": [
          "title",
          "tests"
        ],
        "additionalProperties": false
      }
    }
  }
}

@podhmo podhmo merged commit 61ff967 into main May 3, 2023
@podhmo podhmo deleted the to-schema-prototype branch May 3, 2023 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant