{"id":13508517,"url":"https://github.com/liveforeverx/apix","last_synced_at":"2026-02-19T20:31:08.827Z","repository":{"id":31549765,"uuid":"35114405","full_name":"liveforeverx/apix","owner":"liveforeverx","description":"Simple convention and DSL for transformation of elixir functions to an API for later documentation and or validation.","archived":false,"fork":false,"pushed_at":"2019-10-01T20:42:06.000Z","size":13,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-27T04:36:17.484Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liveforeverx.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-05T17:38:51.000Z","updated_at":"2023-09-01T10:47:22.000Z","dependencies_parsed_at":"2022-09-05T18:12:01.770Z","dependency_job_id":null,"html_url":"https://github.com/liveforeverx/apix","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/liveforeverx/apix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liveforeverx%2Fapix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liveforeverx%2Fapix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liveforeverx%2Fapix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liveforeverx%2Fapix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liveforeverx","download_url":"https://codeload.github.com/liveforeverx/apix/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liveforeverx%2Fapix/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29630829,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T18:02:07.722Z","status":"ssl_error","status_checked_at":"2026-02-19T18:01:46.144Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":[],"created_at":"2024-08-01T02:00:54.237Z","updated_at":"2026-02-19T20:31:08.803Z","avatar_url":"https://github.com/liveforeverx.png","language":"Elixir","funding_links":[],"categories":["Macros"],"sub_categories":[],"readme":"Apix\n====\n\nSimple convention and DSL for transformation of elixir functions to a documented and ready for validation API.\n\nExample of usage (very simple get/put API):\n\n```elixir\ndefmodule Simple.Api do\n  @moduledoc \"\"\"\n  This api describes very simple get/put storage api.\n  And should be a very small example of how to use it.\n  \"\"\"\n  use Apix\n  @name \"SimpleStore\"\n  @tech_name \"store\"\n  api \"Get\", :get\n  api \"Put\", :put\n\n  def ensure_started() do\n    case Process.whereis(:simple) do\n      nil -\u003e\n        {:ok, pid} = Agent.start_link(fn -\u003e %{} end)\n        Process.register(pid, :simple)\n      _ -\u003e\n        :ok\n    end\n  end\n\n  @doc \"\"\"\n  Get value for a defined key\n\n  ## Parameters\n\n    * `:key` - string, must be sent\n    * `:default` - string, optional, defines default, if nothing found to be returned\n\n  ## Results\n\n  \"\"\"\n  def get(%{key: key} = args) do\n    ensure_started()\n    %{result: Agent.get(:simple, \u0026Map.get(\u00261, key, args[:default]))}\n  end\n\n  @doc \"\"\"\n  Put a value for the key\n\n  ## Parameters\n\n    * `:key` - string, describes key, on which it will be saved\n    * `:value` - string, describes value\n\n  ## Results\n\n  \"\"\"\n  def put(%{key: key, value: value} = _args) do\n    ensure_started()\n    Agent.update(:simple, \u0026Map.put(\u00261, key, value))\n    %{result: true}\n  end\nend\n```\n\nNow, it is possible to get information to your API:\n\n```elixir\niex\u003e Apix.spec(Simple.Api, :methods)\n[\"Get\", \"Put\"]\niex\u003e Apix.spec(Simple.Api, :method, \"Put\")\n%{arguments: [key: %{description: \"describes key, on which it will be saved\", optional: false, type: \"string\"},\n              value: %{description: \"describes value\", optional: false, type: \"string\"}],\n  doc: \"Put a value for the key\"}\niex\u003e Apix.spec(Simple.Api, :name)\n\"SimpleStore\"\niex\u003e Apix.spec(Simple.Api, :doc)\n\"This api describes very simple get/put storage api.\\nAnd should be a very small example of how to use it.\\n\"\n```\n\nThere are some word in documetation, which will be identified, for example:\n`## Parameters`, starting the attributes section.\n\nEach attribute should have the same format: \"* `key` - type, description\" or\n\"* `key` - type, optional, description\". Type should be of type, which your validator\nsupports. Apix may support JSON validation in the future.\n\nFor more information, use Apix documentation. All examples are actually tested with `doctest`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliveforeverx%2Fapix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliveforeverx%2Fapix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliveforeverx%2Fapix/lists"}