Context : Due to the extreme extinction towards the Galactic centre ( A _ { V } \sim 30 mag ) , its stellar population is mainly studied in the near-infrared ( NIR ) regime . Therefore , a proper analysis of the NIR extinction curve is necessary to fully characterise the stellar structure and population of the inner part of the galaxy . Aims : We studied the dependence of the extinction index ( \alpha _ { \lambda } ) in the NIR on the line of sight , wavelength , and extinction . Methods : We used the GALACTICNUCLEUS imaging survey , a high angular resolution catalogue ( 0.2 ^ { \prime \prime } ) for the inner part of the Galaxy in JHK _ { s } , and studied the spatial variation in the extinction index . We also applied two independent methods based on red clump stars to compute the extinction index between different bands and its variation with wavelength . Results : We did not detect any significant line-of-sight or extinction variation in \alpha within the studied region in the nuclear stellar disc . The extinction index between JH and HK _ { s } differs by 0.19 \pm 0.05 . We obtained mean values for the extinction indices \alpha _ { JH } = 2.43 \pm 0.03 and \alpha _ { HK _ { s } } = 2.23 \pm 0.03 . The dependence of the extinction index on the wavelength could explain the differences obtained for \alpha _ { \lambda } in the literature since it was assumed constant for the NIR regime . Conclusions :