The Movie Database -tuki

I would like to be able to use swagger-client to create a moviedb node client. It kinda works:

const Swagger = require('swagger-client');
...
mdbClient = new Swagger({
      url: 'https://api.stoplight.io/v1/versions/9WaNJfGpnnQ76opqe/export/oas.json',
      usePromise: true,
      authorizations: {
        api_key: new Swagger.ApiKeyAuthorization('api_key', config.movieDbKey, 'query'),
      },
});
....
mdbClient
      .then(client => {
        return client.apis.default.GET_tv_tv_id({ tv_id: mdbShowId, append_to_response: 'videos' })
      })
      .then(result => {
        return result.obj
      });

which does return the show object. The problem is that it doesn't return the videos, which you'd expect from the append_to_response argument.

When I look at the OAS doc at https://api.stoplight.io/v1/versions/9WaNJfGpnnQ76opqe/export/oas.json:

"/tv/{tv_id}": {
        "parameters": [
            {
                "name": "tv_id",
                "in": "path",
                "required": true,
                "type": "integer"
            }

but when I look at the api docs on the site, the append_to_reponse argument is defined.

So why is whatever swagger docs are generating the onsite api different from what we get at: https://api.stoplight.io/v1/versions/9WaNJfGpnnQ76opqe/export/oas.json

5 vastausta (sivulla 1, sivuja yhteensä 1)

Jump to last post

Hi @moviebuff2022, I'm not sure. Our docs are generated by Stoplight and I don't have much knowledge about any of the particular things around how the params and docs connect up in the OAS file. I just enter data in their UI wink

I'll send them a support ticket tomorrow and see what they say. In the docs editor you can see here how the two sections are split. shrug_tone2

Hi Travis,

Yeah, the docs on the site are definitely correct, what I don't understand is why https://api.stoplight.io/v1/versions/9WaNJfGpnnQ76opqe/export/oas.json is different. It just doesn't have the append_to_reponse parameter (or language for that matter) defined.

Thanks for the speedy response. Let's see what they say.

@travisbell I think you need to update the URL of the oas.json. Seems like it contains version string.

Hi @shantmarouti Thanks for stopping by. As I mentioned above, I don’t generate or control any of that. It’s all controlled by Stoplight.

Unfortunately, Stoplight isn’t supporting the version of the docs we’re using so it’s not likely to get fixed until I spend time upgrading to their new platform.

I found some additional pieces that are pretty out of sync. for instance in movie/search there are 7 possible input params: language, query, page, include_adult, region, year, primary_release_year. In the JSON OAS spec, there are only 2 params: year, primary_release_year

Etkö löydä elokuvaa tai TV-ohjelmaa? Kirjaudu sisään lisätäksesi se.

Koko sivustolla

s keskitä hakukenttään
p avaa profiilivalikko
esc sulje avoin ikkuna
? avaa pikanäppäinikkuna

Mediasivuilla

b palaa takaisin (tai hakemistoon mikäli mahdollista)
e siirry editoimaan sivua

TV-sarjan kausien sivuilla

(oikea nuolinäppäin) siirry seuraavaan kauteen
(vasen nuolinäppäin) siirry edelliseen kauteen

TV-sarjan jaksojen sivuilla

(oikea nuolinäppäin) siirry seuraavaan jaksoon
(vasen nuolinäppäin) siirry edelliseen jaksoon

Kaikilla kuvasivustoilla

a avaa "lisää kuva" ikkuna

Kaikilla muokkaus-sivuilla

t avaa kielivalinta
ctrl+ s Lähetä lomake

Keskustelu sivuilla

n luo uusi keskustelu
w vaihda seurannan asetus
p vaihda julkinen/yksityinen asetus
c vaihda avaa/sulje asetus
a avaa viimeaikainen toiminta
r vastaa keskusteluun
l siirry viimeisimpään vastaukseen
ctrl+ enter Lähetä viesti
(oikea nuolinäppäin) seuraava sivu
(vasen nuolinäppäin) edellinen sivu

Asetukset

Haluatko pisteyttää vai lisätä tämän nimikkeen listaan?

Kirjaudu

Ei rekisteröitynyt jäsen?

Rekisteröidy ja liity mukaan yhteisöön