{"id":15091356,"url":"https://github.com/surrsurus/open_api_spex_typed_struct","last_synced_at":"2026-02-15T08:33:04.601Z","repository":{"id":230268516,"uuid":"778971737","full_name":"surrsurus/open_api_spex_typed_struct","owner":"surrsurus","description":"Automatically generate api specs for your typed structs","archived":false,"fork":false,"pushed_at":"2025-02-17T04:29:15.000Z","size":25,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-17T06:57:40.281Z","etag":null,"topics":["elixir","openapi-specification","plugin"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/surrsurus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-03-28T19:20:49.000Z","updated_at":"2024-10-23T22:21:26.000Z","dependencies_parsed_at":"2024-03-28T19:34:22.218Z","dependency_job_id":"339cfb6b-2c12-4279-8893-b0fe78443fd3","html_url":"https://github.com/surrsurus/open_api_spex_typed_struct","commit_stats":{"total_commits":22,"total_committers":3,"mean_commits":7.333333333333333,"dds":0.2727272727272727,"last_synced_commit":"61c0f6b143197a48747ef547d77f2210eaa9c0ca"},"previous_names":["surrsurus/open_api_spex_typed_struct"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/surrsurus/open_api_spex_typed_struct","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surrsurus%2Fopen_api_spex_typed_struct","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surrsurus%2Fopen_api_spex_typed_struct/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surrsurus%2Fopen_api_spex_typed_struct/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surrsurus%2Fopen_api_spex_typed_struct/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/surrsurus","download_url":"https://codeload.github.com/surrsurus/open_api_spex_typed_struct/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surrsurus%2Fopen_api_spex_typed_struct/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29473718,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T06:58:05.414Z","status":"ssl_error","status_checked_at":"2026-02-15T06:58:05.085Z","response_time":118,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","openapi-specification","plugin"],"created_at":"2024-09-25T10:40:33.670Z","updated_at":"2026-02-15T08:33:04.577Z","avatar_url":"https://github.com/surrsurus.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenApiSpexTypedStruct [![CI](https://github.com/surrsurus/open_api_spex_typed_struct/actions/workflows/ci.yml/badge.svg)](https://github.com/surrsurus/open_api_spex_typed_struct/actions/workflows/ci.yml) [![Hex.pm](https://img.shields.io/hexpm/v/open_api_spex_typed_struct.svg)](https://hex.pm/packages/open_api_spex_typed_struct)\n\nAutomatically generate api specs for your typed structs.\n\nThis library is a plugin for [OpenApiSpex](https://github.com/open-api-spex/open_api_spex) that allows you to define typed structs and have the schema automatically generated for you. You can then easily reference these schemas in your OpenApiSpex operations. This allows you to keep your api specs in sync with your typed structs without having to constantly update two different versions of what is effectively the same schema.\n\n- Give your struct a title and you're all set, the rest is generated for you.\n- You can optionally give `default` values to your fields and they will also be included in the schema.\n- Same for `example`s. Can be combined with default values.\n- Additionally, you can override the generated schema property for specific fields by providing a\n  `property` option to the field. This is for when you want to reference another schema.\n\n## Usage\n\n```elixir\ndefmodule MySpec do\n  use TypedStruct\n\n  typedstruct do\n    plugin(OpenApiSpexTypedStruct, title: \"my spec\", description: \"my description\")\n    field :id, :string, default: \"123\", example: \"456\"\n    field :qty, :integer\n    field :other_schema, :object, property: MyOtherSchema\n  end\nend\n```\n\nGenerates a schema that looks like:\n```elixir\n%OpenApiSpex.Schema%{\n  properties: %{\n    id: %OpenApiSpex.Schema%{type: :string, default: \"123\", example: \"456\"},\n    qty: %OpenApiSpex.Schema%{type: :integer},\n    other_schema: OtherSchema\n  },\n  required: [:id, :qty],\n  title: \"my spec\",\n  description: \"my description\"\n  type: :object\n}\n```\n\nThat can then be used with OpenApiSpex in your controller:\n```elixir\noperation(:index,\n  summary: \"Get fancy new spec-ed things\",\n  responses: [\n    ok: {\"Successful\", \"application/json\", MySpec},\n  ]\n)\n```\n\n## Documentation\n\nRead the docs on HexDocs: https://hexdocs.pm/open_api_spex_typed_struct/OpenApiSpexTypedStruct.html\n\n## Installation\n\nAdd `open_api_spex_typed_struct` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:open_api_spex_typed_struct, github: \"surrsurus/open_api_spex_typed_struct\", tag: \"0.1.1\"}\n  ]\nend\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsurrsurus%2Fopen_api_spex_typed_struct","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsurrsurus%2Fopen_api_spex_typed_struct","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsurrsurus%2Fopen_api_spex_typed_struct/lists"}