Thanks for posting your query
you had hit your shin on the corner of dock and after that there was a swelling.
It might be a contusion
over shin or a minute fracture
So you need a x-ray of leg to rule out fracture.
So you have to visit an orthopaedic surgeon
for exam. of leg & x-ray as required.