# How derived documents are made

Some vendors publish an API but no OpenAPI document for it. For some of these
APIs, [Skmtc Hub](https://skmtc.dev) writes the document itself, from the
vendor's documentation pages. This page tells you how Hub makes such a
document and what it does not contain.

## What a derived document is [#what-a-derived-document-is]

A derived document is an OpenAPI document that Hub wrote from the pages of the
vendor's documentation site. It is not the vendor's document. Hub always
labels it:

- The API page shows the badge **Derived from documentation**.
- The API page lists the documentation pages that Hub read, with the date of
  each check and of each change.
- The history shows the chip **Derived** on each revision that Hub wrote.

The document also records where it came from, in `info['x-skmtc-derived']`.
This record names the pages, the time that Hub read them and the code that
built the document. It also lists the fixes that Hub made to errors in the
vendor's data.

## How Hub writes it [#how-hub-writes-it]

Hub does not use a language model to write a derived document. Code that
reads the structure of the documentation site builds the document. When Hub
runs the same code on the same pages, it gets the same document.

Hub reads the pages again every day. When the document that the pages give is
the same as before, Hub records only the check. When it is different, Hub adds
a new revision to the history.

## What a derived document leaves out [#what-a-derived-document-leaves-out]

The document contains only what the pages state. When a page does not state
something, for example whether a request must include a parameter, the
document leaves it out. Hub does not guess a value.

## How a vendor replaces it [#how-a-vendor-replaces-it]

If you work for the vendor, claim the account of your organization on Hub and
publish your own OpenAPI document. Your document becomes the latest revision,
and the badge goes away. The derived revisions stay in the history.
